mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
use logger service for output appenders
This commit is contained in:
@@ -7,7 +7,6 @@ import { MainThreadOutputServiceShape } from '../common/extHost.protocol';
|
||||
import type * as vscode from 'vscode';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { OutputAppender } from 'vs/workbench/services/output/node/outputAppender';
|
||||
import { toLocalISOString } from 'vs/base/common/date';
|
||||
import { SymlinkSupport } from 'vs/base/node/pfs';
|
||||
import { promises } from 'fs';
|
||||
@@ -16,6 +15,28 @@ import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitData
|
||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||
import { MutableDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { createRotatingLogger } from 'vs/platform/log/node/spdlogLog';
|
||||
import { RotatingLogger } from 'spdlog';
|
||||
import { ByteSize } from 'vs/platform/files/common/files';
|
||||
|
||||
class OutputAppender {
|
||||
|
||||
private appender: RotatingLogger;
|
||||
|
||||
constructor(name: string, readonly file: string) {
|
||||
this.appender = createRotatingLogger(name, file, 30 * ByteSize.MB, 1);
|
||||
this.appender.clearFormatters();
|
||||
}
|
||||
|
||||
append(content: string): void {
|
||||
this.appender.critical(content);
|
||||
}
|
||||
|
||||
flush(): void {
|
||||
this.appender.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class ExtHostOutputChannelBackedByFile extends AbstractExtHostOutputChannel {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user