diff options
Diffstat (limited to 'scripts/parse-log.ts')
-rwxr-xr-x | scripts/parse-log.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 2c5ef696d..9f67c0d53 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | import * as program from 'commander' | ||
1 | import { createReadStream } from 'fs' | 2 | import { createReadStream } from 'fs' |
2 | import { join } from 'path' | 3 | import { join } from 'path' |
3 | import { createInterface } from 'readline' | 4 | import { createInterface } from 'readline' |
@@ -5,6 +6,10 @@ import * as winston from 'winston' | |||
5 | import { labelFormatter } from '../server/helpers/logger' | 6 | import { labelFormatter } from '../server/helpers/logger' |
6 | import { CONFIG } from '../server/initializers/constants' | 7 | import { CONFIG } from '../server/initializers/constants' |
7 | 8 | ||
9 | program | ||
10 | .option('-l, --level [level]', 'Level log (debug/info/warn/error)') | ||
11 | .parse(process.argv) | ||
12 | |||
8 | const excludedKeys = { | 13 | const excludedKeys = { |
9 | level: true, | 14 | level: true, |
10 | message: true, | 15 | message: true, |
@@ -27,7 +32,7 @@ const loggerFormat = winston.format.printf((info) => { | |||
27 | const logger = new winston.createLogger({ | 32 | const logger = new winston.createLogger({ |
28 | transports: [ | 33 | transports: [ |
29 | new winston.transports.Console({ | 34 | new winston.transports.Console({ |
30 | level: 'debug', | 35 | level: program['level'] || 'debug', |
31 | stderrLevels: [], | 36 | stderrLevels: [], |
32 | format: winston.format.combine( | 37 | format: winston.format.combine( |
33 | winston.format.splat(), | 38 | winston.format.splat(), |