Skip to content

Commit

Permalink
ref(feedback): Add treeshaking for logger statements (#9475)
Browse files Browse the repository at this point in the history
via `__DEBUG_BUILD__`
  • Loading branch information
billyvg authored Nov 7, 2023
1 parent e9d1713 commit aa27ff0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/feedback/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Feedback implements Integration {

this._widget = this._createWidget(this.options);
} catch (err) {
logger.error(err);
__DEBUG_BUILD__ && logger.error(err);
}
}

Expand All @@ -201,7 +201,7 @@ export class Feedback implements Integration {
typeof el === 'string' ? doc.querySelector(el) : typeof el.addEventListener === 'function' ? el : null;

if (!targetEl) {
logger.error('[Feedback] Unable to attach to target element');
__DEBUG_BUILD__ && logger.error('[Feedback] Unable to attach to target element');
return null;
}

Expand All @@ -210,7 +210,7 @@ export class Feedback implements Integration {
return widget;
});
} catch (err) {
logger.error(err);
__DEBUG_BUILD__ && logger.error(err);
return null;
}
}
Expand All @@ -222,7 +222,7 @@ export class Feedback implements Integration {
try {
return this._createWidget(mergeOptions(this.options, optionOverrides));
} catch (err) {
logger.error(err);
__DEBUG_BUILD__ && logger.error(err);
return null;
}
}
Expand All @@ -243,7 +243,7 @@ export class Feedback implements Integration {
return true;
}
} catch (err) {
logger.error(err);
__DEBUG_BUILD__ && logger.error(err);
}

return false;
Expand Down

0 comments on commit aa27ff0

Please sign in to comment.