diff --git a/packages/logger/config.js b/packages/logger/config.js deleted file mode 100644 index ed32f80e..00000000 --- a/packages/logger/config.js +++ /dev/null @@ -1,8 +0,0 @@ -import { loadConfig } from '@nostrwatch/utils' - -let config - -if(!config) - config = await loadConfig('logger') - -export default config \ No newline at end of file diff --git a/packages/logger/index.js b/packages/logger/index.js index dcd7e700..78f91979 100644 --- a/packages/logger/index.js +++ b/packages/logger/index.js @@ -1,6 +1,5 @@ import 'dotenv/config' import { appendFile } from 'fs/promises' -import config from './config.js' import createLogger from 'logging'; //wrapper for logging: https://www.npmjs.com/package/logging @@ -8,7 +7,7 @@ export default class Logger { constructor(name, log_level="INFO", split_logs=false) { this.logger = createLogger?.default? createLogger.default(name): createLogger(name) - this.log_level = new String(config?.log_level? config.log_level : log_level).toUpperCase(); + this.log_level = (log_level || 'info').toUpperCase(); this.split_logs = split_logs || false }