@yaagoub/decorators
Version:
Angular decorators
26 lines (25 loc) • 1.31 kB
TypeScript
import { SettingsService } from './ygb-settings.service';
import { YgbContext, YgbLogDestination, YgbLogType } from '../types/ygb-types';
import { SendLogService } from './ygb-send-log.service';
import * as i0 from "@angular/core";
export declare class ControlLogService {
private settings;
private sendLogService;
constructor(settings: SettingsService, sendLogService: SendLogService);
/**
* Controls the logging based on the type, context, destination, and message.
*
* @param type - The type of the log (e.g., error, info, debug).
* @param context - The context in which the log is being made.
* @param destination - The destination where the log should be sent (e.g., console, server, both).
* @param message - The message to be logged.
*
* @example
* const context: YgbContext = { userId: '12345', sessionId: 'abcde' };
* controlLog('info', context, 'console', 'This is an informational message.');
* controlLog('error', undefined, 'server', 'An error occurred.');
*/
controlLog(type: YgbLogType, context: YgbContext | undefined, destination: YgbLogDestination, message: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ControlLogService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ControlLogService>;
}