diff --git a/key_share_node/server/src/auth/discord/index.ts b/key_share_node/server/src/auth/discord/index.ts index 1aab54002..ce0649bbd 100644 --- a/key_share_node/server/src/auth/discord/index.ts +++ b/key_share_node/server/src/auth/discord/index.ts @@ -1,6 +1,8 @@ import type { Result } from "@oko-wallet/stdlib-js"; import type { DiscordTokenInfo } from "@oko-wallet/ksn-interface/auth"; +import { logger } from "@oko-wallet-ksn-server/logger"; + import type { OAuthValidationFail } from "../types"; export async function validateDiscordOAuthToken( @@ -16,7 +18,7 @@ export async function validateDiscordOAuthToken( if (!response.ok) { const errorText = await response.text(); - console.error( + logger.error( "[discord] Failed to get user info: %s %s", response.status, errorText, diff --git a/key_share_node/server/src/bin/launch/git.ts b/key_share_node/server/src/bin/launch/git.ts index d8656e2a4..96def63f3 100644 --- a/key_share_node/server/src/bin/launch/git.ts +++ b/key_share_node/server/src/bin/launch/git.ts @@ -1,11 +1,13 @@ import { execSync } from "child_process"; +import { logger } from "@oko-wallet-ksn-server/logger"; + export function getGitCommitHash(): string | null { try { const commitHash = execSync("git rev-parse --short HEAD").toString().trim(); return commitHash; } catch (err: any) { - console.error("Error getting Git commit hash:", err.message); + logger.error("Error getting Git commit hash: %s", err.message); return null; } diff --git a/key_share_node/server/src/bin/launch/index.ts b/key_share_node/server/src/bin/launch/index.ts index a8d0c4606..144fbfc4d 100644 --- a/key_share_node/server/src/bin/launch/index.ts +++ b/key_share_node/server/src/bin/launch/index.ts @@ -21,7 +21,7 @@ const ONE_DAY_MS = 1 * 86400; async function main() { const opts = parseCLIArgs(); - console.log("Launching ks node server, cli args: %j", opts); + logger.info("Launching ks node server, cli args: %j", opts); logger.info("Launching, Logger initialized"); loadEnv(opts.nodeId); diff --git a/key_share_node/server/src/database/index.ts b/key_share_node/server/src/database/index.ts index f237c23db..4fd227981 100644 --- a/key_share_node/server/src/database/index.ts +++ b/key_share_node/server/src/database/index.ts @@ -65,7 +65,7 @@ export async function resetPgDatabase(pool: Pool) { for (let idx = 0; idx < tables.length; idx += 1) { const tbl = tables[idx]; - console.log("Truncate table: %s", tbl); + logger.debug("Truncate table: %s", tbl); const res = await truncateTable(client, tbl); if (res.success === false) {