mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -7,13 +7,15 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { ILogService, LogLevel, NullLogService, AbstractLogService } from 'vs/platform/log/common/log';
|
||||
import { RotatingLogger, setAsyncMode } from 'spdlog';
|
||||
import * as spdlog from 'spdlog';
|
||||
|
||||
export function createSpdLogService(processName: string, logLevel: LogLevel, logsFolder: string): ILogService {
|
||||
// Do not crash if spdlog cannot be loaded
|
||||
try {
|
||||
setAsyncMode(8192, 2000);
|
||||
const _spdlog: typeof spdlog = require.__$__nodeRequire('spdlog');
|
||||
_spdlog.setAsyncMode(8192, 2000);
|
||||
const logfilePath = path.join(logsFolder, `${processName}.log`);
|
||||
const logger = new RotatingLogger(processName, logfilePath, 1024 * 1024 * 5, 6);
|
||||
const logger = new _spdlog.RotatingLogger(processName, logfilePath, 1024 * 1024 * 5, 6);
|
||||
logger.setLevel(0);
|
||||
|
||||
return new SpdLogService(logger, logLevel);
|
||||
@@ -28,7 +30,7 @@ class SpdLogService extends AbstractLogService implements ILogService {
|
||||
_serviceBrand: any;
|
||||
|
||||
constructor(
|
||||
private readonly logger: RotatingLogger,
|
||||
private readonly logger: spdlog.RotatingLogger,
|
||||
level: LogLevel = LogLevel.Error
|
||||
) {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user