mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 00:05:28 +01:00
change the default log format (#163268)
* change the default log format * also change in file log * fix compilation
This commit is contained in:
committed by
GitHub
parent
2149a31611
commit
adefb9aae2
@@ -21,7 +21,7 @@ export class FileLogger extends AbstractLogger implements ILogger {
|
||||
private backupIndex: number = 1;
|
||||
|
||||
constructor(
|
||||
private readonly name: string,
|
||||
name: string,
|
||||
private readonly resource: URI,
|
||||
level: LogLevel,
|
||||
private readonly donotUseFormatters: boolean,
|
||||
@@ -101,7 +101,7 @@ export class FileLogger extends AbstractLogger implements ILogger {
|
||||
if (this.donotUseFormatters) {
|
||||
content += message;
|
||||
} else {
|
||||
content += `[${this.getCurrentTimestamp()}] [${this.name}] [${this.stringifyLogLevel(level)}] ${message}\n`;
|
||||
content += `${this.getCurrentTimestamp()} [${this.stringifyLogLevel(level)}] ${message}\n`;
|
||||
}
|
||||
await this.fileService.writeFile(this.resource, VSBuffer.fromString(content));
|
||||
});
|
||||
|
||||
@@ -15,6 +15,8 @@ async function createSpdLogLogger(name: string, logfilePath: string, filesize: n
|
||||
const logger = await _spdlog.createAsyncRotatingLogger(name, logfilePath, filesize, filecount);
|
||||
if (donotUseFormatters) {
|
||||
logger.clearFormatters();
|
||||
} else {
|
||||
logger.setPattern('%Y-%m-%d %H:%M:%S.%e [%l] %v');
|
||||
}
|
||||
return logger;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user