export interface Tracer { warn ( message ) : void ; error ( error ) : any ; } class NoOpTracer implements Tracer { warn ( message ) { } error ( error ) { } } class ConsoleTracer implements Tracer { warn ( message ) { console . warn ( message ) ; } error ( error ) { console . error ( error ) ; } } export class Trace { private static tracer : Tracer = new ConsoleTracer ( ) ; static configure ( tracer ) { Trace . tracer = tracer ; } static off ( ) { Trace . tracer = new NoOpTracer ( ) ; } static warn ( message ) { this . tracer . warn ( message ) ; } static error ( error ) { this . tracer . error ( error ) ; } }