Logger now always logs verbosely to file

This commit is contained in:
plane000
2018-10-30 18:56:47 +00:00
parent 80101f349b
commit 44b5b47456
2 changed files with 8 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
# Specification of command manager and modules
- Ability to

View File

@@ -46,25 +46,25 @@ export class Logger {
static get WARN_LOGS() {return 3;}
static database(message) {
if (LogLevel > 0) return;
let d = moment().format(dateFormat);
fs.appendFileSync(logPath, `[${d.toLocaleString()}] [${Dialect}] ${message} \n`);
if (LogLevel > 0) return;
console.log('[' + d.toLocaleString() + '] ['
+ colours.magenta(Dialect) + '] ' + message);
}
static middleware(message) {
if (LogLevel > 0) return;
let d = moment().format(dateFormat);
fs.appendFileSync(logPath, `[${d.toLocaleString()}] [MIDDLEWARE] ${message} \n`);
if (LogLevel > 0) return;
console.log('[' + d.toLocaleString() + '] ['
+ colours.blue('MIDDLEWARE') + '] ' + message);
}
static debug(message) {
if (LogLevel > 1) return;
let d = moment().format(dateFormat);
fs.appendFileSync(logPath, `[${d.toLocaleString()}] [DEBUG] ${message} \n`);
if (LogLevel > 1) return;
console.log('[' + d.toLocaleString() + '] ['
+ colours.cyan('DEBUG') + '] ' + message);
}
@@ -77,17 +77,17 @@ export class Logger {
}
static info(message) {
if (LogLevel > 2) return;
let d = moment().format(dateFormat);
fs.appendFileSync(logPath, `[${d.toLocaleString()}] [INFO] ${message} \n`);
if (LogLevel > 2) return;
console.log('[' + d.toLocaleString() + '] ['
+ colours.green('INFO') + '] ' + message);
}
static warn(message) {
if (LogLevel > 3) return;
let d = moment().format(dateFormat);
fs.appendFileSync(logPath, `[${d.toLocaleString()}] [WARN] ${message} \n`);
if (LogLevel > 3) return;
console.log('[' + d.toLocaleString() + '] ['
+ colours.yellow('WARN') + '] ' + message);
}