UNPKG

@mcma/core

Version:

Node module with type definitions and helper utils for the EBU MCMA framework

42 lines (41 loc) 1.61 kB
import { McmaTrackerProperties } from "../model"; import { LogEvent } from "./log-event"; export declare enum LogLevel { Fatal = 100, Error = 200, Warn = 300, Info = 400, Debug = 500 } export declare enum LogType { Fatal = "FATAL", Error = "ERROR", Warn = "WARN", Info = "INFO", Debug = "DEBUG" } export interface Logger { debug(message: any, ...optionalParams: any[]): void; info(message: any, ...optionalParams: any[]): void; warn(message: any, ...optionalParams: any[]): void; error(message: any, ...optionalParams: any[]): void; fatal(message: any, ...optionalParams: any[]): void; functionStart(message: any, ...optionalParams: any[]): void; functionEnd(message: any, ...optionalParams: any[]): void; jobStart(message: any, ...optionalParams: any[]): void; jobUpdate(message: any, ...optionalParams: any[]): void; jobEnd(message: any, ...optionalParams: any[]): void; } export declare abstract class Logger implements Logger { private readonly _source; private readonly _requestId; private readonly _tracker?; protected constructor(source: string, requestId?: string, tracker?: McmaTrackerProperties); protected get source(): string; protected get requestId(): string; protected get tracker(): McmaTrackerProperties; static System: Logger; protected buildLogEvent(level: number, type: string, message: any, ...optionalParams: any[]): LogEvent; log(level: number, type: string, message: any, ...optionalParams: any[]): void; protected abstract writeLogEvent(logEvent: LogEvent): void; }