Merge pull request #5637 from Tyriar/remove_trace

Remove trace decorator and unused platform consts
This commit is contained in:
Daniel Imms
2026-01-30 07:34:45 -08:00
committed by GitHub
3 changed files with 1 additions and 39 deletions
-2
View File
@@ -39,8 +39,6 @@ export function getSafariVersion(): number {
// and ISO third level shifts.
// http://stackoverflow.com/q/19877924/577598
export const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);
export const isIpad = platform === 'iPad';
export const isIphone = platform === 'iPhone';
export const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);
export const isLinux = platform.indexOf('Linux') >= 0;
// Note that when this is true, isLinux will also be true.
-30
View File
@@ -43,9 +43,6 @@ export class LogService extends Disposable implements ILogService {
super();
this._updateLogLevel();
this._register(this._optionsService.onSpecificOptionChange('logLevel', () => this._updateLogLevel()));
// For trace logging, assume the latest created log service is valid
traceLogger = this;
}
private _updateLogLevel(): void {
@@ -95,30 +92,3 @@ export class LogService extends Disposable implements ILogService {
}
}
}
let traceLogger: ILogService;
export function setTraceLogger(logger: ILogService): void {
traceLogger = logger;
}
/**
* A decorator that can be used to automatically log trace calls to the decorated function.
*/
export function traceCall(_target: any, key: string, descriptor: any): any {
if (typeof descriptor.value !== 'function') {
throw new Error('not supported');
}
const fnKey = 'value';
const fn = descriptor.value;
descriptor[fnKey] = function (...args: any[]) {
// Early exit
if (traceLogger.logLevel !== LogLevelEnum.TRACE) {
return fn.apply(this, args);
}
traceLogger.trace(`GlyphRenderer#${fn.name}(${args.map(e => JSON.stringify(e)).join(', ')})`);
const result = fn.apply(this, args);
traceLogger.trace(`GlyphRenderer#${fn.name} return`, result);
return result;
};
}