Logger Service
class LoggerService
logger.service.ts
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class LoggerService {
private readonly _isLoggingEnabled: boolean;
public constructor() {
// Buy to unlock
}
public logClassInitialization(className: string): void {
// Buy to unlock
}
public logComponentInitialization(componentName: string): void {
// Buy to unlock
}
public logDirectiveInitialization(directiveName: string): void {
// Buy to unlock
}
public logError(error: Error): void {
// Buy to unlock
}
public logException(exception: unknown): void {
// Buy to unlock
}
public logMessages(...messages: string[]): void {
// Buy to unlock
}
public logServiceInitialization(serviceName: string): void {
// Buy to unlock
}
public logWarning(warning: string): void {
// Buy to unlock
}
private _logIfEnabled(logFunction: () => void): void {
// Buy to unlock
}
}
Last updated
Was this helpful?