Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as path from 'path';
import { ILogService, LogLevel, NullLogService, AbstractLogService } from 'vs/platform/log/common/log';
import * as spdlog from 'spdlog';
@@ -13,7 +11,7 @@ export function createSpdLogService(processName: string, logLevel: LogLevel, log
// Do not crash if spdlog cannot be loaded
try {
const _spdlog: typeof spdlog = require.__$__nodeRequire('spdlog');
_spdlog.setAsyncMode(8192, 2000);
_spdlog.setAsyncMode(8192, 500);
const logfilePath = path.join(logsFolder, `${processName}.log`);
const logger = new _spdlog.RotatingLogger(processName, logfilePath, 1024 * 1024 * 5, 6);
logger.setLevel(0);
@@ -25,6 +23,11 @@ export function createSpdLogService(processName: string, logLevel: LogLevel, log
return new NullLogService();
}
export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): spdlog.RotatingLogger {
const _spdlog: typeof spdlog = require.__$__nodeRequire('spdlog');
return new _spdlog.RotatingLogger(name, filename, filesize, filecount);
}
class SpdLogService extends AbstractLogService implements ILogService {
_serviceBrand: any;