mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 01:25:38 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import { createDecorator as createServiceDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export const ILogService = createServiceDecorator<ILogService>('logService');
|
||||
@@ -300,7 +300,6 @@ export class NullLogService implements ILogService {
|
||||
dispose(): void { }
|
||||
}
|
||||
|
||||
|
||||
export function getLogLevel(environmentService: IEnvironmentService): LogLevel {
|
||||
if (environmentService.verbose) {
|
||||
return LogLevel.Trace;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { LogLevel, ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
|
||||
import Event, { buffer } from 'vs/base/common/event';
|
||||
import { Event, buffer } from 'vs/base/common/event';
|
||||
|
||||
export interface ILogLevelSetterChannel extends IChannel {
|
||||
call(command: 'event:onDidChangeLogLevel'): TPromise<LogLevel>;
|
||||
|
||||
@@ -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