diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:33:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:45:08 +0100 |
commit | ba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch) | |
tree | 6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /scripts/parse-log.ts | |
parent | 29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff) | |
download | PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip |
Update server dependencies
Diffstat (limited to 'scripts/parse-log.ts')
-rwxr-xr-x | scripts/parse-log.ts | 10 |
1 files changed, 6 insertions, 4 deletions
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 | |||
17 | .option('-f, --files [file...]', 'Files to parse. If not provided, the script will parse the latest log file from config)') | 17 | .option('-f, --files [file...]', 'Files to parse. If not provided, the script will parse the latest log file from config)') |
18 | .parse(process.argv) | 18 | .parse(process.argv) |
19 | 19 | ||
20 | const options = program.opts() | ||
21 | |||
20 | const excludedKeys = { | 22 | const excludedKeys = { |
21 | level: true, | 23 | level: true, |
22 | message: true, | 24 | message: true, |
@@ -38,7 +40,7 @@ const loggerFormat = winston.format.printf((info) => { | |||
38 | if (CONFIG.LOG.PRETTIFY_SQL) { | 40 | if (CONFIG.LOG.PRETTIFY_SQL) { |
39 | additionalInfos += '\n' + sqlFormat(info.sql, { | 41 | additionalInfos += '\n' + sqlFormat(info.sql, { |
40 | language: 'sql', | 42 | language: 'sql', |
41 | ident: ' ' | 43 | indent: ' ' |
42 | }) | 44 | }) |
43 | } else { | 45 | } else { |
44 | additionalInfos += ' - ' + info.sql | 46 | additionalInfos += ' - ' + info.sql |
@@ -51,7 +53,7 @@ const loggerFormat = winston.format.printf((info) => { | |||
51 | const logger = winston.createLogger({ | 53 | const logger = winston.createLogger({ |
52 | transports: [ | 54 | transports: [ |
53 | new winston.transports.Console({ | 55 | new winston.transports.Console({ |
54 | level: program['level'] || 'debug', | 56 | level: options.level || 'debug', |
55 | stderrLevels: [], | 57 | stderrLevels: [], |
56 | format: winston.format.combine( | 58 | format: winston.format.combine( |
57 | winston.format.splat(), | 59 | winston.format.splat(), |
@@ -76,7 +78,7 @@ run() | |||
76 | .catch(err => console.error(err)) | 78 | .catch(err => console.error(err)) |
77 | 79 | ||
78 | function run () { | 80 | function run () { |
79 | return new Promise(async res => { | 81 | return new Promise<void>(async res => { |
80 | const files = await getFiles() | 82 | const files = await getFiles() |
81 | 83 | ||
82 | for (const file of files) { | 84 | for (const file of files) { |
@@ -114,7 +116,7 @@ async function getNewestFile (files: string[], basePath: string) { | |||
114 | } | 116 | } |
115 | 117 | ||
116 | async function getFiles () { | 118 | async function getFiles () { |
117 | if (program['files']) return program['files'] | 119 | if (options.files) return options.files |
118 | 120 | ||
119 | const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR) | 121 | const logFiles = await readdir(CONFIG.STORAGE.LOG_DIR) |
120 | 122 | ||