Skip to content

LoggerAppenders

@tsed/logger

Usage

typescript
import { LoggerAppenders } from "@tsed/logger";

See /packages/logger/src/types/common/logger/class/LoggerAppenders.ts.

Overview

ts
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

ts
get size(): number;

has

ts
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

ts
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

ts
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

ts
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

ts
clear(): void;

The `clear() method removes all elements from a loggerAppenders object.

forEach

ts
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

ts
toArray(): any[];

byLogLevel

ts
byLogLevel(loggingLevel: LogLevel): BaseAppender[];

Return all appenders that match with the given loggingLevel.

Released under the MIT License.