File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +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 |
7677| `beforeSend` | function(event) => event | optional | This Method allows you to filter any data you don't want sending to Hawk |
7778
7879Other available [initial settings](types/hawk-initial-settings.d.ts) are described at the type definition.
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ export default class Catcher {
9292 */
9393 private readonly disableVueErrorHandler : boolean = false ;
9494
95+ /**
96+ * Disable console log handler
97+ */
98+ private readonly disableConsoleLogHandler : boolean = false ;
99+
95100 /**
96101 * Catcher constructor
97102 *
@@ -111,6 +116,7 @@ export default class Catcher {
111116 this . context = settings . context || undefined ;
112117 this . beforeSend = settings . beforeSend ;
113118 this . disableVueErrorHandler = settings . disableVueErrorHandler ?? false ;
119+ this . disableConsoleLogHandler = settings . disableConsoleLogHandler ?? false ;
114120
115121 if ( ! this . token ) {
116122 log (
@@ -136,7 +142,10 @@ export default class Catcher {
136142 } ,
137143 } ) ;
138144
139- initConsoleCatcher ( ) ;
145+ if ( ! settings . disableConsoleLogHandler ) {
146+ initConsoleCatcher ( ) ;
147+ console . log ( 'Console log handler initialized' ) ;
148+ }
140149
141150 /**
142151 * Set global handlers
Original file line number Diff line number Diff line change @@ -73,4 +73,9 @@ export interface HawkInitialSettings {
7373 * Used by @hawk.so/nuxt since Nuxt has own error hook.
7474 */
7575 disableVueErrorHandler ?: boolean ;
76+
77+ /**
78+ * Disable console log handler
79+ */
80+ disableConsoleLogHandler ?: boolean ;
7681}
You can’t perform that action at this time.
0 commit comments