File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ export class Options {
22
22
storeAs : string ;
23
23
}
24
24
25
+ // For browsers that don't implement the debug method, log will be used instead. Fixes #62.
26
+ const CONSOLE_DEBUG_METHOD = console [ "debug" ] ? "debug" : "log" ;
27
+
25
28
// Temporal until https://github.com/angular/angular/issues/7344 gets fixed.
26
29
const DEFAULT_OPTIONS : Options = {
27
30
level : Level . WARN ,
@@ -39,7 +42,7 @@ export class Logger {
39
42
private _store : boolean ;
40
43
private _storeAs : string ;
41
44
42
- Level :any = Level ;
45
+ Level : any = Level ;
43
46
44
47
constructor ( @Optional ( ) options ?: Options ) {
45
48
@@ -72,7 +75,7 @@ export class Logger {
72
75
}
73
76
74
77
debug ( message ?: any , ...optionalParams : any [ ] ) {
75
- this . isDebugEnabled ( ) && console . debug . apply ( console , arguments ) ;
78
+ this . isDebugEnabled ( ) && ( < any > console ) [ CONSOLE_DEBUG_METHOD ] . apply ( console , arguments ) ;
76
79
}
77
80
78
81
log ( message ?: any , ...optionalParams : any [ ] ) {
You can’t perform that action at this time.
0 commit comments