aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/parse-log.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/parse-log.ts')
-rwxr-xr-xscripts/parse-log.ts7
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 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths() 2registerTSPaths()
3 3
4import * as program from 'commander' 4import { program } from 'commander'
5import { createReadStream, readdir } from 'fs-extra' 5import { createReadStream, readdir } from 'fs-extra'
6import { join } from 'path' 6import { join } from 'path'
7import { createInterface } from 'readline' 7import { 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
146function containsTags (loggerTags: string[], optionsTags: string[]) { 149function containsTags (loggerTags: string[], optionsTags: string[]) {