我面临与https://github.com/winstonjs/winston/issues/1416相同的logger.info('Hello there. How are you?');
问题�[32minfo�[39m: �[32mHello there. How are you?�[39m
我不知道在哪里colorize
可以删除它,这是我的代码:
new winston.transports.File({
format: winston.format.combine(
winston.format.colorize({ // I added this but it's still not helping
all: false,
message: false,
level: false,
}),
winston.format.label({ label: 'API' }),
winston.format.timestamp(),
winston.format.printf(({ level, message, label, timestamp }) => {
return `${timestamp} [${label}] ${level}: ${message}`;
}),
),
filename: environment.logDirectory,
level: 'http',
maxsize: 1024 * 1024 * 10,
}),
中main.ts
,我有
import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston';
app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));
在AppModule.ts
中,我有以下内容:
import { WinstonModule } from 'nest-winston';
...
WinstonModule.forRoot({
transports,
}),
我找不到任何使用的地方,colorize()
我不知道如何禁用它。
我正在使用"nest-winston": "^1.4.0",
和"winston": "^3.3.3",