From 88a827276ecd6623fabc94c94f4dff856088e073 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 19 Dec 2022 11:42:51 -0500 Subject: [PATCH] *Update references of log object --- src/index.ts | 3 --- src/lib/error.ts | 2 +- src/modules/app.ts | 2 +- src/modules/plugin.ts | 2 +- src/modules/relay.ts | 2 +- src/modules/ssl.ts | 2 +- src/modules/swarm.ts | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9e6500a..471dbf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,12 @@ import { start as startRpc } from "./modules/rpc.js"; import { start as startRelay } from "./modules/relay.js"; import { start as startApp } from "./modules/app"; -import log from "loglevel"; import config from "./config.js"; import { loadPlugins } from "./modules/plugin.js"; import { start as startSwarm } from "./modules/swarm.js"; import * as bip39 from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english"; -log.setDefaultLevel(config.str("log-level")); - if (!config.str("seed")) { config.save("account.json", { seed: bip39.generateMnemonic(wordlist), diff --git a/src/lib/error.ts b/src/lib/error.ts index cc310fc..96c3a60 100644 --- a/src/lib/error.ts +++ b/src/lib/error.ts @@ -1,4 +1,4 @@ -import log from "loglevel"; +import { log } from "../log.js"; export function errorExit(msg: string): void { log.error(msg); diff --git a/src/modules/app.ts b/src/modules/app.ts index 2cfce39..d8ec8ea 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -1,5 +1,5 @@ import { AddressInfo } from "net"; -import log from "loglevel"; +import { log } from "./log.js"; import fastify from "fastify"; import type { FastifyInstance } from "fastify"; import { getKeyPair } from "../lib/seed.js"; diff --git a/src/modules/plugin.ts b/src/modules/plugin.ts index 2dda2e1..d744f0f 100644 --- a/src/modules/plugin.ts +++ b/src/modules/plugin.ts @@ -12,7 +12,7 @@ import pluginRpc from "./plugins/rpc"; import pluginCore from "./plugins/core"; import type Config from "@lumeweb/cfg"; import EventEmitter2 from "eventemitter2"; -import log from "loglevel"; +import { log } from "./log.js"; import { get as getSwarm } from "./swarm.js"; let pluginAPIManager: PluginAPIManager; diff --git a/src/modules/relay.ts b/src/modules/relay.ts index fd0db7d..f786268 100644 --- a/src/modules/relay.ts +++ b/src/modules/relay.ts @@ -8,7 +8,7 @@ import config from "../config.js"; import { get as getSwarm } from "./swarm.js"; import { get as getSslManager } from "./ssl.js"; // @ts-ignore -import log from "loglevel"; +import { log } from "./log.js"; import { AddressInfo } from "net"; // @ts-ignore import promiseRetry from "promise-retry"; diff --git a/src/modules/ssl.ts b/src/modules/ssl.ts index 4d365f5..d426b93 100644 --- a/src/modules/ssl.ts +++ b/src/modules/ssl.ts @@ -1,6 +1,6 @@ import * as tls from "tls"; import b4a from "b4a"; -import log from "loglevel"; +import { log } from "./log.js"; import config from "../config.js"; export type SSLManagerRenewHandler = (domain: string) => Promise; diff --git a/src/modules/swarm.ts b/src/modules/swarm.ts index 9bb625e..00147ca 100644 --- a/src/modules/swarm.ts +++ b/src/modules/swarm.ts @@ -9,7 +9,7 @@ import DHT from "@hyperswarm/dht"; // @ts-ignore import sodium from "sodium-universal"; import b4a from "b4a"; -import log from "loglevel"; +import { log } from "../log.js"; import { getKeyPair } from "../lib/seed.js"; const LUMEWEB = b4a.from("lumeweb");