Skip to content

Commit eb6bac6

Browse files
authored
Fix logging to use electron-log (#304)
1 parent 0ef1638 commit eb6bac6

File tree

18 files changed

+31
-26
lines changed

18 files changed

+31
-26
lines changed

main/api/accounts/handleImportAccount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import log from "electron-log";
1+
import log from "electron-log/main";
22
import * as z from "zod";
33

44
import { manager } from "../manager";

main/api/chainport/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import log from "electron-log/main";
12
import { z } from "zod";
23

34
import {
@@ -16,7 +17,6 @@ import {
1617
assertTokenPathsApiResponse,
1718
assertTokensApiResponse,
1819
} from "../../../shared/chainport";
19-
import { logger } from "../ironfish/logger";
2020
import { manager } from "../manager";
2121
import { t } from "../trpc";
2222

@@ -38,7 +38,7 @@ export const chainportRouter = t.router({
3838
),
3939
};
4040
} catch (err) {
41-
logger.error(`Failed to fetch Chainport tokens data.
41+
log.error(`Failed to fetch Chainport tokens data.
4242
4343
${err}
4444
`);
@@ -71,7 +71,7 @@ ${err}
7171
chainportTokenPaths: tokenPathsData,
7272
};
7373
} catch (err) {
74-
logger.error(`Failed to fetch Chainport token paths data.
74+
log.error(`Failed to fetch Chainport token paths data.
7575
7676
${err}
7777
`);
@@ -103,7 +103,7 @@ ${err}
103103
to,
104104
);
105105
} catch (err) {
106-
logger.error(`Failed to fetch Chainport bridge transaction details.
106+
log.error(`Failed to fetch Chainport bridge transaction details.
107107
108108
${err}
109109
`);

main/api/ironfish/Ironfish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
RpcMemoryClient,
1313
getPackageFrom,
1414
} from "@ironfish/sdk";
15-
import log from "electron-log";
15+
import log from "electron-log/main";
1616
import { v4 as uuid } from "uuid";
1717

1818
import { logger } from "./logger";

main/api/ironfish/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MAINNET, TESTNET } from "@ironfish/sdk";
2-
import log from "electron-log";
2+
import log from "electron-log/main";
33
import { z } from "zod";
44

55
import { manager } from "../manager";

main/api/ironfish/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Logger } from "@ironfish/sdk";
22
import consola, { ConsolaReporterLogObject, LogLevel, logType } from "consola";
3-
import log from "electron-log";
3+
import log from "electron-log/main";
44

55
const logPrefix = "[node]";
66

main/api/snapshot/snapshotManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fsAsync from "fs/promises";
22

33
import { Event, FullNode, IronfishSdk, Meter } from "@ironfish/sdk";
4-
import log from "electron-log";
4+
import log from "electron-log/main";
55

66
import {
77
DownloadedSnapshot,

main/api/transactions/utils/formatTransactionsToNotes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RpcAsset, RpcClient, RpcWalletTransaction } from "@ironfish/sdk";
2-
import log from "electron-log";
2+
import log from "electron-log/main";
33

44
import { IRON_ID } from "@shared/constants";
55
import { TransactionNote } from "@shared/types";

main/api/updates/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from "axios";
22
import { app } from "electron";
3-
import log from "electron-log";
3+
import log from "electron-log/main";
44
import { clean, gt } from "semver";
55

66
import { PartialGithubRelease } from "../../../shared/types";

main/api/utils/promiseQueue.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import log from "electron-log/main";
2+
13
export class PromiseQueue {
24
private queue: Array<() => Promise<unknown>> = [];
35
private isProcessing = false;
@@ -12,7 +14,7 @@ export class PromiseQueue {
1214
try {
1315
await task();
1416
} catch (error) {
15-
console.error("PromiseQueue task error:", error);
17+
log.error("PromiseQueue task error:", error);
1618
}
1719
}
1820
}

main/api/window/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { app, dialog } from "electron";
2-
import log from "electron-log";
2+
import log from "electron-log/main";
33

44
import { mainWindow } from "../../main-window";
55
import { t } from "../trpc";

0 commit comments

Comments
 (0)