Skip to content

Commit

Permalink
add isLevelEnabled check around stringify call
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed May 31, 2024
1 parent f6b66c8 commit 2169a4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kbn-analytics/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class Reporter {
const metrics = wrapArray(eventNames).map((eventName) => {
this.logger.debug(`${type} Metric -> (${appName}:${eventName}):`);
const report = createUiCounterMetric({ type, appName, eventName, count });
this.logger.debug(JSON.stringify(report));
if (this.logger.isLevelEnabled('debug')) {
this.logger.debug(JSON.stringify(report));
}
return report;
});
this.saveToReport(metrics);
Expand Down

0 comments on commit 2169a4c

Please sign in to comment.