feat(MED-168): disable useless console logs on browserside, too many logs
This commit is contained in:
@@ -4,6 +4,9 @@ const noop = (event: string) => {
|
|||||||
// do nothing - this is to prevent errors when the analytics service is not initialized
|
// do nothing - this is to prevent errors when the analytics service is not initialized
|
||||||
|
|
||||||
return async (...args: unknown[]) => {
|
return async (...args: unknown[]) => {
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.debug(
|
console.debug(
|
||||||
`Noop analytics service called with event: ${event}`,
|
`Noop analytics service called with event: ${event}`,
|
||||||
...args.filter(Boolean),
|
...args.filter(Boolean),
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import { MonitoringService } from '@kit/monitoring-core';
|
|||||||
|
|
||||||
export class ConsoleMonitoringService implements MonitoringService {
|
export class ConsoleMonitoringService implements MonitoringService {
|
||||||
identifyUser(data: { id: string }) {
|
identifyUser(data: { id: string }) {
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log(`[Console Monitoring] Identified user`, data);
|
console.log(`[Console Monitoring] Identified user`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,6 +15,9 @@ export class ConsoleMonitoringService implements MonitoringService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
captureEvent(event: string) {
|
captureEvent(event: string) {
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log(`[Console Monitoring] Captured event: ${event}`);
|
console.log(`[Console Monitoring] Captured event: ${event}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user