Last active
December 29, 2016 10:02
-
-
Save badpenguin/0ddeac8bb665d5057e52625374f925cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* simple replacement for angular1 $log service | |
* https://www.antoniogallo.it/ | |
*/ | |
declare var console: any; | |
export class $log { | |
static has_debug: boolean = true; | |
static error( ...args: any[] ) : void { | |
( console && console.error ) && console.error( ...args ); | |
} | |
static warn( ...args: any[] ) : void { | |
( console && console.warn ) && console.warn( ...args ); | |
} | |
static info( ...args: any[] ) : void { | |
( console && console.info ) && console.info( ...args ); | |
} | |
static debug( ...args: any[] ) : void { | |
( $log.has_debug && console && console.debug ) && console.debug( ...args ); | |
} | |
static log( ...args: any[] ) : void { | |
( console && console.log ) && console.log( ...args ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment