@ngworker/lumberjack
Version:
Lumberjack is a versatile Angular logging library, specifically designed to be extended and customized
84 lines (83 loc) • 3.86 kB
TypeScript
import { LumberjackLogPayload } from '../logs/lumberjack-log-payload';
import { LumberjackLog } from '../logs/lumberjack.log';
import * as i0 from "@angular/core";
/**
* Service with programmatic API to pass logs to Lumberjack. Optionally
* supports a log payload.
*
* Lumberjack passes the logs to the registered log drivers based on their
* configurations.
*
* NOTE! Consider extending the `LumberjackLogger` or `ScopedLumberjackLogger`
* base classes to set up predefined loggers unless you need a programmatic
* API.
*/
export declare class LumberjackService<TPayload extends LumberjackLogPayload | void = void> {
#private;
constructor();
/**
* Pass a log to Lumberjack which will be forwarded to the registered log
* drivers based on their configurations.
*
* NOTE! It's recommended to use `LumberjackLogBuilder` to create the log.
*
* @param lumberjackLog The Lumberjack log. Optionally supports a log payload.
*/
log(lumberjackLog: LumberjackLog<TPayload>): void;
/**
* Pass a critical log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logCritical(message: string, payload?: TPayload, scope?: string): void;
/**
* Pass an error log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logError(message: string, payload?: TPayload, scope?: string): void;
/**
* Pass a warning log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logWarning(message: string, payload?: TPayload, scope?: string): void;
/**
* Pass an info log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logInfo(message: string, payload?: TPayload, scope?: string): void;
/**
* Pass a debug log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logDebug(message: string, payload?: TPayload, scope?: string): void;
/**
* Pass a trace log to Lumberjack which will be forwarded to the registered
* log drivers based on their configurations.
*
* @param message Log message, for example describing an event that happened.
* @param payload An optional payload to add to the log.
* @param scope An optional scope to add to the {@link LumberjackLog}.
*/
logTrace(message: string, payload?: TPayload, scope?: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<LumberjackService<any>, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<LumberjackService<any>>;
}