Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
properties.description = typeof message === 'string' ? message : `${message}`;
properties.fatal = logLevel === LogLevel.Critical;
this._analytics$.pipe(
tap((analyticsService) => {
analyticsService.logEvent('exception', properties);
}),
runOutsideAngular(this._zone)
).subscribe();
} else {
let level: string;
if (logLevel === LogLevel.Trace) {
level = 'trace';
} else if (logLevel === LogLevel.Debug) {
level = 'debug';
} else if (logLevel === LogLevel.Info) {
level = 'info';
} else {
level = 'warn';
}
properties.message = typeof message === 'string' ? message : `${message}`;
properties.level = level;
this._analytics$.pipe(
tap((analyticsService) => {
analyticsService.logEvent('trace', properties);
}),
runOutsideAngular(this._zone)
).subscribe();
}
}
if (this._userInfo.accountId) {
properties.account_id = this._userInfo.accountId;
}
if (logLevel === LogLevel.Error || logLevel === LogLevel.Critical) {
properties.description = typeof message === 'string' ? message : `${message}`;
properties.fatal = logLevel === LogLevel.Critical;
this._analytics.logEvent('exception', properties);
} else {
let level: string;
if (logLevel === LogLevel.Trace) {
level = 'trace';
} else if (logLevel === LogLevel.Debug) {
level = 'debug';
} else if (logLevel === LogLevel.Info) {
level = 'info';
} else {
level = 'warn';
}
properties.message = typeof message === 'string' ? message : `${message}`;
properties.level = level;
this._analytics.logEvent('trace', properties);
}
}