mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -11,6 +11,10 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
|
||||
export const ILogService = createServiceDecorator<ILogService>('logService');
|
||||
|
||||
function now(): string {
|
||||
return new Date().toISOString();
|
||||
}
|
||||
|
||||
export enum LogLevel {
|
||||
Trace,
|
||||
Debug,
|
||||
@@ -69,9 +73,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
trace(message: string, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Trace) {
|
||||
if (this.useColors) {
|
||||
console.log(`\x1b[90m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.log(`\x1b[90m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.log(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.log(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,9 +83,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
debug(message: string, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Debug) {
|
||||
if (this.useColors) {
|
||||
console.log(`\x1b[90m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.log(`\x1b[90m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.log(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.log(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,9 +93,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
info(message: string, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Info) {
|
||||
if (this.useColors) {
|
||||
console.log(`\x1b[90m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.log(`\x1b[90m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.log(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.log(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,9 +103,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
warn(message: string | Error, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Warning) {
|
||||
if (this.useColors) {
|
||||
console.warn(`\x1b[93m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.warn(`\x1b[93m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.warn(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.warn(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,9 +113,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
error(message: string, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Error) {
|
||||
if (this.useColors) {
|
||||
console.error(`\x1b[91m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.error(`\x1b[91m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.error(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.error(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,9 +123,9 @@ export class ConsoleLogMainService extends AbstractLogService implements ILogSer
|
||||
critical(message: string, ...args: any[]): void {
|
||||
if (this.getLevel() <= LogLevel.Critical) {
|
||||
if (this.useColors) {
|
||||
console.error(`\x1b[90m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, message, ...args);
|
||||
console.error(`\x1b[90m[main ${now()}]\x1b[0m`, message, ...args);
|
||||
} else {
|
||||
console.error(`[main ${new Date().toLocaleTimeString()}]`, message, ...args);
|
||||
console.error(`[main ${now()}]`, message, ...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/node/ipc';
|
||||
import { LogLevel, ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
|
||||
import { Event, buffer } from 'vs/base/common/event';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
||||
export class LogLevelSetterChannel implements IServerChannel {
|
||||
|
||||
onDidChangeLogLevel: Event<LogLevel>;
|
||||
|
||||
constructor(private service: ILogService) {
|
||||
this.onDidChangeLogLevel = buffer(service.onDidChangeLogLevel, true);
|
||||
this.onDidChangeLogLevel = Event.buffer(service.onDidChangeLogLevel, true);
|
||||
}
|
||||
|
||||
listen(_, event: string): Event<any> {
|
||||
@@ -23,7 +23,7 @@ export class LogLevelSetterChannel implements IServerChannel {
|
||||
throw new Error(`Event not found: ${event}`);
|
||||
}
|
||||
|
||||
call(_, command: string, arg?: any): Thenable<any> {
|
||||
call(_, command: string, arg?: any): Promise<any> {
|
||||
switch (command) {
|
||||
case 'setLevel': this.service.setLevel(arg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user