From ba5a8d89bbf049e4afc41543bcc072cccdb02669 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 Feb 2021 09:33:05 +0100 Subject: Update server dependencies --- scripts/parse-log.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/parse-log.ts') diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 045348e86..3679dab74 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts @@ -17,6 +17,8 @@ program .option('-f, --files [file...]', 'Files to parse. If not provided, the script will parse the latest log file from config)') .parse(process.argv) +const options = program.opts() + const excludedKeys = { level: true, message: true, @@ -38,7 +40,7 @@ const loggerFormat = winston.format.printf((info) => { if (CONFIG.LOG.PRETTIFY_SQL) { additionalInfos += '\n' + sqlFormat(info.sql, { language: 'sql', - ident: ' ' + indent: ' ' }) } else { additionalInfos += ' - ' + info.sql @@ -51,7 +53,7 @@ const loggerFormat = winston.format.printf((info) => { const logger = winston.createLogger({ transports: [ new winston.transports.Console({ - level: program['level'] || 'debug', + level: options.level || 'debug', stderrLevels: [], format: winston.format.combine( winston.format.splat(), @@ -76,7 +78,7 @@ run() .catch(err => console.error(err)) function run () { - return new Promise(async res => { + return new Promise(async res => { const files = await getFiles() for (const file of files) { @@ -114,7 +116,7 @@ async function getNewestFile (files: string[], basePath: string) { } async function getFiles () { - if (program['files']) return program['files'] + if (options.files) return options.files const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR) -- cgit v1.2.3