File tree 4 files changed +16
-4
lines changed
4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { ILog } from './ILog' ;
2
2
3
3
export class ConsoleLog implements ILog {
4
+ public trace ( message : string ) : void {
5
+ this . log ( 'trace' , message ) ;
6
+ }
7
+
4
8
public info ( message : string ) : void {
5
9
this . log ( 'info' , message ) ;
6
10
}
@@ -14,8 +18,14 @@ export class ConsoleLog implements ILog {
14
18
}
15
19
16
20
private log ( level : string , message : string ) {
17
- if ( console && console [ level ] ) {
18
- console [ level ] ( `[${ level } ] Exceptionless: ${ message } ` ) ;
21
+ if ( console ) {
22
+ let msg = `[${ level } ] Exceptionless: ${ message } ` ;
23
+
24
+ if ( console [ level ] ) {
25
+ console [ level ] ( msg ) ;
26
+ } else if ( console . log ) {
27
+ console [ `log` ] ( msg ) ;
28
+ }
19
29
}
20
30
}
21
31
}
Original file line number Diff line number Diff line change 1
1
export interface ILog {
2
+ trace ( message : string ) : void ;
2
3
info ( message : string ) : void ;
3
4
warn ( message : string ) : void ;
4
5
error ( message : string ) : void ;
Original file line number Diff line number Diff line change 1
1
import { ILog } from './ILog' ;
2
2
3
3
export class NullLog implements ILog {
4
+ public trace ( message : string ) : void { }
4
5
public info ( message : string ) : void { }
5
6
public warn ( message : string ) : void { }
6
7
public error ( message : string ) : void { }
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ export class DuplicateCheckerPlugin implements IEventPlugin {
60
60
}
61
61
62
62
if ( this . _processedHashcodes . some ( h => h . hash === hashCode && h . timestamp >= ( now - this . _interval ) ) ) {
63
- context . log . info ( 'Adding event with hash: ' + hashCode ) ;
63
+ context . log . trace ( 'Adding event with hash: ' + hashCode ) ;
64
64
this . _mergedEvents . push ( new MergedEvent ( hashCode , context , count ) ) ;
65
65
context . cancelled = true ;
66
66
return ;
67
67
}
68
68
69
- context . log . info ( 'Enqueueing event with hash: ' + hashCode + 'to cache.' ) ;
69
+ context . log . trace ( 'Enqueueing event with hash: ' + hashCode + 'to cache.' ) ;
70
70
this . _processedHashcodes . push ( { hash : hashCode , timestamp : now } ) ;
71
71
72
72
// Only keep the last 50 recent errors.
You can’t perform that action at this time.
0 commit comments