diff --git a/README.md b/README.md index 605c9a0..5d16d25 100755 --- a/README.md +++ b/README.md @@ -193,7 +193,6 @@ Set these before launching the server (`VAR="" npm run start`) | DOMAIN | string | The domain that the server should use for redirects, cookies, etc. ex.: `qmining.com`, without 'https://', and '/'-s. If not specified `./data/domain` will be used | | NS_NO_HTTPS_FORCE | boolean | Disables automatic redirects from http to https | | NS_THREAD_COUNT | number | Nubmer of CPU cores to use | - | NS_LOGLEVEL | number | Debug log level, 0 is the least verbose | | NS_SQL_DEBUG_LOG | boolean | If the SQL queries should be logged | | NS_NOUSER | boolean | If the authorization should be skipped (for testing) | | NS_NOLOG | boolean | If logging should be skipped | diff --git a/src/modules/api/submodules/userManagement.ts b/src/modules/api/submodules/userManagement.ts index 56bff1a..1bfbb6a 100644 --- a/src/modules/api/submodules/userManagement.ts +++ b/src/modules/api/submodules/userManagement.ts @@ -74,7 +74,9 @@ function createDefaultUser(userDb: Database) { created: new Date().getTime(), }) logger.Log('ID and PW for user #1: ', 'yellowbg') + console.log() console.log(`ID: #${insertRes.lastInsertRowid}, PW: "${pw}"`) + console.log() logger.Log('It can be also viewed in the users db file.') } diff --git a/src/utils/logger.ts b/src/utils/logger.ts index d0fdbfd..e015baa 100755 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -33,7 +33,6 @@ const logFileName = 'log' // TODO: on process exit write all const writeInterval = 10 -const debugLevel = parseInt(process.env.NS_LOGLEVEL) || 0 let vData = {} // visit data let dvData = {} // visit data, but daily @@ -55,22 +54,8 @@ function getColoredDateString(): string { } function DebugLog(msg: string | object, name: string, lvl: number): void { - if (lvl <= debugLevel) { - if (msg === 'hr') { - msg = hr - } - let res = msg - const header = `${C('red')}#DEBUG${lvl}#${C( - 'yellow' - )}${name.toUpperCase()}${C('red')}#${C()}${DELIM}${C()}` - if (typeof msg !== 'object') { - res = header + msg - } else { - Log(header + 'OBJECT:', 'yellow') - res = msg - } - Log(res, 'yellow') - } + console.warn('deprecated') + console.log(msg, name, lvl) } function Log(msg: string | object, color?: string): void {