diff options
Diffstat (limited to 'scripts/parse-log.ts')
-rwxr-xr-x | scripts/parse-log.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 5f4480c88..c16503589 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' | 1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | 2 | registerTSPaths() |
3 | 3 | ||
4 | import * as program from 'commander' | 4 | import { program } from 'commander' |
5 | import { createReadStream, readdir } from 'fs-extra' | 5 | import { createReadStream, readdir } from 'fs-extra' |
6 | import { join } from 'path' | 6 | import { join } from 'path' |
7 | import { createInterface } from 'readline' | 7 | import { createInterface } from 'readline' |
@@ -85,6 +85,8 @@ function run () { | |||
85 | const files = await getFiles() | 85 | const files = await getFiles() |
86 | 86 | ||
87 | for (const file of files) { | 87 | for (const file of files) { |
88 | if (file === 'peertube-audit.log') continue | ||
89 | |||
88 | console.log('Opening %s.', file) | 90 | console.log('Opening %s.', file) |
89 | 91 | ||
90 | const stream = createReadStream(file) | 92 | const stream = createReadStream(file) |
@@ -140,7 +142,8 @@ function toTimeFormat (time: string) { | |||
140 | 142 | ||
141 | if (isNaN(timestamp) === true) return 'Unknown date' | 143 | if (isNaN(timestamp) === true) return 'Unknown date' |
142 | 144 | ||
143 | return new Date(timestamp).toISOString() | 145 | const d = new Date(timestamp) |
146 | return d.toLocaleString() + `.${d.getMilliseconds()}` | ||
144 | } | 147 | } |
145 | 148 | ||
146 | function containsTags (loggerTags: string[], optionsTags: string[]) { | 149 | function containsTags (loggerTags: string[], optionsTags: string[]) { |