class Debugger { constructor ( protected readonly console , protected readonly showMessages , protected readonly prefix ) { } public info ( ... message ) { if ( this . showMessages ) { this . console . info ( this . prefix , ... message ) ; } } public warn ( ... message ) { this . console . warn ( this . prefix , ... message ) ; } } const SHOW_DEBUG = false ; export const debug = new Debugger ( console , SHOW_DEBUG , "[webrtc-direct]" ) ;