diff --git a/src/config.ts b/src/config.ts index 3af2a7e..20c3c2f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ import Config from "@lumeweb/cfg"; import * as os from "os"; import * as fs from "fs"; import path from "path"; -import { log } from "./log.js"; +import log from "./log.js"; const config = new Config("lumeweb-relay"); diff --git a/src/lib/error.ts b/src/lib/error.ts index 96c3a60..c1489cc 100644 --- a/src/lib/error.ts +++ b/src/lib/error.ts @@ -1,4 +1,4 @@ -import { log } from "../log.js"; +import log from "../log.js"; export function errorExit(msg: string): void { log.error(msg); diff --git a/src/log.ts b/src/log.ts index 1aed3b1..99ab7c4 100644 --- a/src/log.ts +++ b/src/log.ts @@ -5,4 +5,5 @@ const stream = pretty({ colorize: true, }); -export const log = pino(stream); +const log = pino(stream); +export default log; diff --git a/src/modules/app.ts b/src/modules/app.ts index d8ec8ea..be97a7a 100644 --- a/src/modules/app.ts +++ b/src/modules/app.ts @@ -1,5 +1,5 @@ import { AddressInfo } from "net"; -import { log } from "./log.js"; +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 d744f0f..2c36886 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 "./log.js"; +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 f786268..8d0b71c 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 "./log.js"; +import log from "./log.js"; import { AddressInfo } from "net"; // @ts-ignore import promiseRetry from "promise-retry"; diff --git a/src/modules/rpc/cache.ts b/src/modules/rpc/cache.ts index 9e1cce1..9936ca7 100644 --- a/src/modules/rpc/cache.ts +++ b/src/modules/rpc/cache.ts @@ -8,7 +8,7 @@ import jsonStringify from "json-stringify-deterministic"; // @ts-ignore import crypto from "hypercore-crypto"; import NodeCache from "node-cache"; -import { log } from "../../log.js"; +import log from "../../log.js"; export class RPCCache extends EventEmitter { private server: RPCServer; diff --git a/src/modules/ssl.ts b/src/modules/ssl.ts index d426b93..fe4c050 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 "./log.js"; +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 00147ca..3dc479e 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 "../log.js"; +import log from "../log.js"; import { getKeyPair } from "../lib/seed.js"; const LUMEWEB = b4a.from("lumeweb");