X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fparse-log.ts;h=58e052b9f6c3ec364358e4fca62176a03e34e090;hb=6c733e46174c3f5b185402f9d37c88175543cf3c;hp=fe87db009b685324720a820e5cf884139686d264;hpb=74dc3bca2b14f5fd3fe80c394dfc34177a46db77;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index fe87db009..58e052b9f 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts @@ -1,3 +1,6 @@ +import { registerTSPaths } from '../server/helpers/register-ts-paths' +registerTSPaths() + import * as program from 'commander' import { createReadStream, readdir } from 'fs-extra' import { join } from 'path' @@ -5,7 +8,7 @@ import { createInterface } from 'readline' import * as winston from 'winston' import { labelFormatter } from '../server/helpers/logger' import { CONFIG } from '../server/initializers/config' -import { mtimeSortFilesDesc } from '../shared/utils/logs/logs' +import { mtimeSortFilesDesc } from '../shared/core-utils/logs/logs' program .option('-l, --level [level]', 'Level log (debug/info/warn/error)') @@ -37,7 +40,7 @@ const logger = winston.createLogger({ stderrLevels: [], format: winston.format.combine( winston.format.splat(), - labelFormatter, + labelFormatter(), winston.format.colorize(), loggerFormat ) @@ -76,7 +79,7 @@ function run () { // Don't know why but loggerFormat does not remove splat key Object.assign(log, { splat: undefined }) - logLevels[ log.level ](log) + logLevels[log.level](log) }) stream.once('close', () => res()) @@ -87,7 +90,7 @@ function run () { async function getNewestFile (files: string[], basePath: string) { const sorted = await mtimeSortFilesDesc(files, basePath) - return (sorted.length > 0) ? sorted[ 0 ].file : '' + return (sorted.length > 0) ? sorted[0].file : '' } function toTimeFormat (time: string) {