import * as ts from 'typescript/lib/tsserverlibrary' ; export class Logger implements ts . server . Logger { constructor ( private readonly traceToConsole , private readonly level ) { } public hasLevel ( level ) { return this . loggingEnabled ( ) && this . level >= level ; } public loggingEnabled ( ) { return this . traceToConsole ; } public perftrc ( s ) { this . msg ( s , ts . server . Msg . Perf ) ; } public info ( s ) { this . msg ( s , ts . server . Msg . Info ) ; } public msg ( s , type = ts . server . Msg . Err ) { if ( ! this . traceToConsole ) { return ; } if ( type === ts . server . Msg . Info ) { console . log ( s ) ; } if ( type === ts . server . Msg . Err ) { console . error ( s ) ; } if ( type === ts . server . Msg . Perf ) { console . warn ( s ) ; } } public close ( ) { } public startGroup ( ) { } public endGroup ( ) { } public getLogFileName ( ) { return null ; } }