@log4js2/core
Version:
log4js2 is a fast and lightweight logging library that enables logging flexibility within JavaScript/TypeScript applications, similar to Apache's [Log4j2 library](https://logging.apache.org/log4j/2.x/). It can also serve as a drop-in replacement for log4
44 lines (43 loc) • 1.1 kB
TypeScript
import { LogLevel } from '../const/log.level';
import { ILogEvent } from '../log.event';
export declare abstract class LogAppender<C extends {}> {
private active;
private logLevel;
private layout;
constructor(config?: C);
/**
* Returns whether or not the appender is active
* @returns {boolean}
*/
isActive(): boolean;
/**
* Appends the log
* @param {ILogEvent} logEvent
*/
append(logEvent: ILogEvent): void;
/**
* Gets the current log level
* @returns {number}
*/
getLogLevel(): LogLevel;
/**
* Sets the log level of the appender
* @param {LogLevel} logLevel
*/
setLogLevel(logLevel: LogLevel): void;
/**
* Sets the layout of the appender
* @param {string} layout
*/
setLayout(layout: string): void;
/**
* Gets the layout associated with the appender
* @returns {string}
*/
getLayout(): string;
/**
* Formats the log event using the layout provided
* @param {ILogEvent} logEvent
*/
format(logEvent: ILogEvent): string;
}