Skip to content

Commit

Permalink
remove monitoring service and references to removed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
codaimaster committed Aug 25, 2023
1 parent 99ded24 commit 1e23c39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 83 deletions.
9 changes: 1 addition & 8 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ import { AcceptTermsService } from './services/acceptTerms/acceptTerms.service';
import { CaseShareService } from './services/case/share-case.service';
import { DefaultErrorHandler } from './services/errorHandler/defaultErrorHandler';
import { JurisdictionService } from './services/jurisdiction/jurisdiction.service';
import { AbstractAppInsights, AppInsightsWrapper } from './services/logger/appInsightsWrapper';
import { CryptoWrapper } from './services/logger/cryptoWrapper';
import { LoggerService } from './services/logger/logger.service';
import { MonitoringService } from './services/logger/monitoring.service';
import { SharedModule } from './shared/shared.module';
import { effects } from './store/effects';
// ngrx modules - END
Expand Down Expand Up @@ -125,12 +123,7 @@ export function launchDarklyClientIdFactory(
multi: true
},
CryptoWrapper,
MonitoringService,
LoggerService,
{
provide: AbstractAppInsights,
useClass: AppInsightsWrapper
},
{
provide: ErrorHandler,
useClass: DefaultErrorHandler
Expand All @@ -150,4 +143,4 @@ export function launchDarklyClientIdFactory(
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
export class AppModule { }
21 changes: 6 additions & 15 deletions src/app/services/logger/logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { environment as config } from '../../../environments/environment';
import { UserInfo } from '../../models/user-details.model';
import { SessionStorageService } from '../session-storage/session-storage.service';
import { CryptoWrapper } from './cryptoWrapper';
import { MonitoringService } from './monitoring.service';
import { EnvironmentService } from '../../shared/services/environment.service';

export interface ILoggerService {
Expand All @@ -26,11 +25,10 @@ export class LoggerService implements ILoggerService {
// Do nothing.
};

constructor(private readonly monitoringService: MonitoringService,
private readonly ngxLogger: NGXLogger,
private readonly sessionStorageService: SessionStorageService,
private readonly cryptoWrapper: CryptoWrapper,
private readonly environmentService: EnvironmentService) {
constructor(private readonly ngxLogger: NGXLogger,
private readonly sessionStorageService: SessionStorageService,
private readonly cryptoWrapper: CryptoWrapper,
private readonly environmentService: EnvironmentService) {
this.COOKIE_KEYS = {
TOKEN: config.cookies.token,
USER: config.cookies.userId
Expand All @@ -46,54 +44,47 @@ export class LoggerService implements ILoggerService {
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public trace(message: any, ... additional: any[]): void {
public trace(message: any, ...additional: any[]): void {
const formattedMessage = this.getMessage(message);
this.ngxLogger.trace(formattedMessage);
this.monitoringService.logEvent(message);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public debug(message: any, ...additional: any[]): void {
const formattedMessage = this.getMessage(message);
this.ngxLogger.debug(formattedMessage);
this.monitoringService.logEvent(message);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public info(message: any, ...additional: any[]): void {
const formattedMessage = this.getMessage(message);
this.ngxLogger.info(formattedMessage);
this.monitoringService.logEvent(message);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public log(message: any, ...additional: any[]): void {
const formattedMessage = this.getMessage(message);
this.ngxLogger.log(formattedMessage, ...additional);
this.monitoringService.logEvent(message);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public warn(message: any, ...additional: any[]): void {
const formattedMessage = this.getMessage(message);
this.ngxLogger.warn(formattedMessage);
this.monitoringService.logEvent(message);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public error(message: any, ...additional: any[]): void {
this.ngxLogger.error(message);
const formattedMessage = this.getMessage(message);
const error = new Error(formattedMessage);
this.monitoringService.logException(error);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
public fatal(message: any, ...additional: any[]): void {
this.ngxLogger.fatal(message);
const formattedMessage = this.getMessage(message);
const error = new Error(formattedMessage);
this.monitoringService.logException(error);
}

public getMessage(message: any): string {
Expand All @@ -109,7 +100,7 @@ export class LoggerService implements ILoggerService {
}

public enableCookies(): void {
this.monitoringService.enableCookies();
// this.monitoringService.enableCookies();
}

public static switchConsoleLogs(consoleConfig: any): void {
Expand Down
60 changes: 0 additions & 60 deletions src/app/services/logger/monitoring.service.spec.ts

This file was deleted.

0 comments on commit 1e23c39

Please sign in to comment.