Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -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();