File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11import { ILog } from './ILog' ;
22
33export class ConsoleLog implements ILog {
4+ public trace ( message : string ) : void {
5+ this . log ( 'trace' , message ) ;
6+ }
7+
48 public info ( message : string ) : void {
59 this . log ( 'info' , message ) ;
610 }
@@ -14,8 +18,14 @@ export class ConsoleLog implements ILog {
1418 }
1519
1620 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+ }
1929 }
2030 }
2131}
Original file line number Diff line number Diff line change 11export interface ILog {
2+ trace ( message : string ) : void ;
23 info ( message : string ) : void ;
34 warn ( message : string ) : void ;
45 error ( message : string ) : void ;
Original file line number Diff line number Diff line change 11import { ILog } from './ILog' ;
22
33export class NullLog implements ILog {
4+ public trace ( message : string ) : void { }
45 public info ( message : string ) : void { }
56 public warn ( message : string ) : void { }
67 public error ( message : string ) : void { }
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ export class DuplicateCheckerPlugin implements IEventPlugin {
6060 }
6161
6262 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 ) ;
6464 this . _mergedEvents . push ( new MergedEvent ( hashCode , context , count ) ) ;
6565 context . cancelled = true ;
6666 return ;
6767 }
6868
69- context . log . info ( 'Enqueueing event with hash: ' + hashCode + 'to cache.' ) ;
69+ context . log . trace ( 'Enqueueing event with hash: ' + hashCode + 'to cache.' ) ;
7070 this . _processedHashcodes . push ( { hash : hashCode , timestamp : now } ) ;
7171
7272 // Only keep the last 50 recent errors.
You can’t perform that action at this time.
0 commit comments