Skip to content

Commit bb0414d

Browse files
committed
Change some .info calls to .trace
1 parent cdf55c8 commit bb0414d

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

src/logging/ConsoleLog.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { ILog } from './ILog';
22

33
export 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
}

src/logging/ILog.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export interface ILog {
2+
trace(message: string): void;
23
info(message: string): void;
34
warn(message: string): void;
45
error(message: string): void;

src/logging/NullLog.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ILog } from './ILog';
22

33
export 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 { }

src/plugins/default/DuplicateCheckerPlugin.ts

+2-2
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)