LoggerAppenders
Usage
import { LoggerAppenders } from "@tsed/logger";
See /packages/logger/src/types/common/logger/class/LoggerAppenders.ts.
Overview
class LoggerAppenders {
get size(): number;
has(name: string): boolean;
get(name: string): LoggerAppender;
set(name: string, config: Omit<AppenderConfiguration, "options"> & {
type: string | any;
options?: any;
}): LoggerAppenders;
delete(name: string): boolean;
clear(): void;
forEach(callback: (value: LoggerAppender, key: string, map: Map<string, LoggerAppender>) => void, thisArg?: any): void;
toArray(): any[];
byLogLevel(loggingLevel: LogLevel): BaseAppender[];
}
get size
get size(): number;
has
has(name: string): boolean;
- name (
string
): Required. The key of the element to test for presence in the Map object.`
The `has() method returns a boolean indicating whether an element with the specified configuration name exists or not.
get
get(name: string): LoggerAppender;
- name (
string
): Required. The configuration of the element to return from the Map object.
The `get() method returns a specified element from a loggerAppenders.
set
set(name: string, config: Omit<AppenderConfiguration, "options"> & {
type: string | any;
options?: any;
}): LoggerAppenders;
The set()
method adds or updates an element with a specified key and value to a loggerAppenders object.
delete
delete(name: string): boolean;
- name (
string
): Required. The key of the element to remove from the loggerAppenders object.
Remove all configuration that match with the name
.
clear
clear(): void;
The `clear() method removes all elements from a loggerAppenders object.
forEach
forEach(callback: (value: LoggerAppender, key: string, map: Map<string, LoggerAppender>) => void, thisArg?: any): void;
callback (
(value: LoggerAppender
): Function to execute for each element.thisArg (
any
): Optional. Value to use as this when executing callback.
The forEach()
method executes a provided function once per each key/value pair in the loggerAppenders object, in insertion order.
toArray
toArray(): any[];
byLogLevel
byLogLevel(loggingLevel: LogLevel): BaseAppender[];
Return all appenders that match with the given loggingLevel.