import colors from 'colors' ; /**
 * Dimensions Logging Class
 */ export class Logger { default public identifier : string ; default public identifierColor = colors . bold . green ; param level param identifier constructor ( public level = Logger . LEVEL . INFO , identifier = 'Log' ) { this . identifier = identifier ; } getIdentifier ( ) { return this . identifierColor ( this . identifier ) ; } bar ( type = '' ) { return `\n-=-=-=-=-=-=-=-=-=-=-=-| ${ type } ${ this . getIdentifier ( ) } |-=-=-=-=-=-=-=-=-=-=-=-\n` ; } importantBar ( ) { console . log ( this . bar ( colors . red ( '[IMPORTANT]' ) ) ) ; } important ( ... message ) { console . log ( `${ colors . red ( '[IMPORTANT]' ) } (${ this . identifier }) -` , ... message ) ; } systemIObar ( ) { if ( this . level >= Logger . LEVEL . SYSTEM_IO ) console . log ( this . bar ( colors . red ( '[SYSTEM I/O]' ) ) ) ; } systemIO ( ... message ) { if ( this . level >= Logger . LEVEL . SYSTEM_IO ) console . log ( `${ colors . red ( '[SYSTEM I/O]' ) } (${ this . identifier }) -` , ... message ) ; } systembar ( ) { if ( this . level >= Logger . LEVEL . SYSTEM ) console . log ( this . bar ( colors . red ( '[SYSTEM]' ) ) ) ; } system ( ... message ) { if ( this . level >= Logger . LEVEL . SYSTEM ) console . log ( `${ colors . red ( '[SYSTEM]' ) } (${ this . identifier }) -` , ... message ) ; } detailbar ( ) { if ( this . level >= Logger . LEVEL . DETAIL ) console . log ( this . bar ( colors . grey ( '[DETAIL]' ) ) ) ; } detail ( ... message ) { if ( this . level >= Logger . LEVEL . DETAIL ) console . log ( `${ colors . grey ( '[DETAIL]' ) } (${ this . identifier }) -` , ... message ) ; } infobar ( ) { if ( this . level >= Logger . LEVEL . INFO ) console . log ( this . bar ( colors . blue ( '[INFO]' ) ) ) ; } info ( ... message ) { if ( this . level >= Logger . LEVEL . INFO ) console . log ( `${ colors . blue ( '[INFO]' ) } (${ this . identifier }) -` , ... message ) ; } warnbar ( ) { if ( this . level >= Logger . LEVEL . WARN ) console . log ( this . bar ( colors . yellow ( '[WARN]' ) ) ) ; } warn ( ... message ) { if ( this . level >= Logger . LEVEL . WARN ) console . log ( `${ colors . yellow ( '[WARN]' ) } (${ this . identifier }) -` , ... message ) ; } errorbar ( ) { if ( this . level >= Logger . LEVEL . ERROR ) console . log ( this . bar ( colors . red ( '[ERROR]' ) ) ) ; } error ( ... message ) { if ( this . level >= Logger . LEVEL . ERROR ) console . log ( `${ colors . red ( '[ERROR]' ) } (${ this . identifier }) -` , ... message ) ; } custom ( label , level , ... message ) { if ( this . level >= level ) { console . log ( `${ label }` , ... message ) ; } } } export namespace Logger { /**
     * Logging Levels where the order of levels are NONE, ERROR, ..., SYSTEM_IO, ALL
     */ export enum LEVEL { /** No logs */ NONE , /** Error logs */ ERROR , /** Warning logs */ WARN , /** Info logs */ INFO , /** Detail logs. For finer details above INFO and below SYSTEM */ DETAIL , /** System level logs */ SYSTEM , /** System IO logs. All I/O related details */ SYSTEM_IO , /** All logs */ ALL } }