Skip to content

Commit acb251f

Browse files
committed
consoleTracking
1 parent 519359c commit acb251f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Initialization settings:
7373
| `vue` | Vue constructor | optional | Pass Vue constructor to set up the [Vue integration](#integrate-to-vue-application) |
7474
| `disableGlobalErrorsHandling` | boolean | optional | Do not initialize global errors handling |
7575
| `disableVueErrorHandler` | boolean | optional | Do not initialize Vue errors handling |
76-
| `disableConsoleLogHandler` | boolean | optional | Do not initialize console logs tracking |
76+
| `consoleTracking` | boolean | optional | Initialize console logs tracking |
7777
| `beforeSend` | function(event) => event | optional | This Method allows you to filter any data you don't want sending to Hawk |
7878

7979
Other available [initial settings](types/hawk-initial-settings.d.ts) are described at the type definition.

src/catcher.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export default class Catcher {
9393
private readonly disableVueErrorHandler: boolean = false;
9494

9595
/**
96-
* Disable console log handler
96+
* Console log handler
9797
*/
98-
private readonly disableConsoleLogHandler: boolean = false;
98+
private readonly consoleTracking: boolean = true;
9999

100100
/**
101101
* Catcher constructor
@@ -116,7 +116,7 @@ export default class Catcher {
116116
this.context = settings.context || undefined;
117117
this.beforeSend = settings.beforeSend;
118118
this.disableVueErrorHandler = settings.disableVueErrorHandler ?? false;
119-
this.disableConsoleLogHandler = settings.disableConsoleLogHandler ?? false;
119+
this.consoleTracking = settings.consoleTracking ?? true;
120120

121121
if (!this.token) {
122122
log(
@@ -142,7 +142,7 @@ export default class Catcher {
142142
},
143143
});
144144

145-
if (!settings.disableConsoleLogHandler) {
145+
if (settings.consoleTracking) {
146146
initConsoleCatcher();
147147
}
148148

@@ -245,7 +245,7 @@ export default class Catcher {
245245
* Add error to console logs
246246
*/
247247

248-
if (!this.disableConsoleLogHandler) {
248+
if (this.consoleTracking) {
249249
addErrorEvent(event);
250250
}
251251

@@ -513,7 +513,7 @@ export default class Catcher {
513513
const userAgent = window.navigator.userAgent;
514514
const location = window.location.href;
515515
const getParams = this.getGetParams();
516-
const consoleLogs = !this.disableConsoleLogHandler ? getConsoleLogStack() : [];
516+
const consoleLogs = this.consoleTracking ? getConsoleLogStack() : [];
517517

518518
const addons: JavaScriptAddons = {
519519
window: {

src/types/hawk-initial-settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export interface HawkInitialSettings {
7575
disableVueErrorHandler?: boolean;
7676

7777
/**
78-
* Disable console log handler
78+
* Console log handler
7979
*/
80-
disableConsoleLogHandler?: boolean;
80+
consoleTracking?: boolean;
8181
}

0 commit comments

Comments
 (0)