X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fparse-log.ts;h=58e052b9f6c3ec364358e4fca62176a03e34e090;hb=7ed1edbbe4ffbef28093e4f5630751cb652814e4;hp=66a5b87198fa990005d865b8e7b3edf7833de6d0;hpb=fd8710b897a67518d3a61c319e54b6a65ba443ef;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts index 66a5b8719..58e052b9f 100755 --- a/scripts/parse-log.ts +++ b/scripts/parse-log.ts @@ -1,11 +1,14 @@ +import { registerTSPaths } from '../server/helpers/register-ts-paths' +registerTSPaths() + import * as program from 'commander' import { createReadStream, readdir } from 'fs-extra' import { join } from 'path' import { createInterface } from 'readline' import * as winston from 'winston' import { labelFormatter } from '../server/helpers/logger' -import { CONFIG } from '../server/initializers/constants' -import { mtimeSortFilesDesc } from '../shared/utils/logs/logs' +import { CONFIG } from '../server/initializers/config' +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) {