diff --git a/addons/addon-webgl/src/WebglAddon.ts b/addons/addon-webgl/src/WebglAddon.ts index 7dc3ed35..dd596be4 100644 --- a/addons/addon-webgl/src/WebglAddon.ts +++ b/addons/addon-webgl/src/WebglAddon.ts @@ -9,10 +9,9 @@ import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRender import { ITerminal } from 'browser/Types'; import { Disposable, toDisposable } from 'common/Lifecycle'; import { getSafariVersion, isSafari } from 'common/Platform'; -import { ICoreService, IDecorationService, ILogService, IOptionsService } from 'common/services/Services'; +import { ICoreService, IDecorationService, IOptionsService } from 'common/services/Services'; import { IWebGL2RenderingContext } from './Types'; import { WebglRenderer } from './WebglRenderer'; -import { setTraceLogger } from 'common/services/LogService'; import { Emitter, EventUtils } from 'common/Event'; export class WebglAddon extends Disposable implements ITerminalAddon , IWebglApi { @@ -66,13 +65,8 @@ export class WebglAddon extends Disposable implements ITerminalAddon , IWebglApi const charSizeService: ICharSizeService = unsafeCore._charSizeService; const coreBrowserService: ICoreBrowserService = unsafeCore._coreBrowserService; const decorationService: IDecorationService = unsafeCore._decorationService; - const logService: ILogService = unsafeCore._logService; const themeService: IThemeService = unsafeCore._themeService; - // Set trace logger just in case it hasn't been yet which could happen when the addon is - // bundled separately to the core module - setTraceLogger(logService); - this._renderer = this._register(new WebglRenderer( terminal, characterJoinerService, diff --git a/src/common/Platform.ts b/src/common/Platform.ts index ec34acde..cc13c1af 100644 --- a/src/common/Platform.ts +++ b/src/common/Platform.ts @@ -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. diff --git a/src/common/services/LogService.ts b/src/common/services/LogService.ts index 12c5e3b0..8bc1e0aa 100644 --- a/src/common/services/LogService.ts +++ b/src/common/services/LogService.ts @@ -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; - }; -}