Skip to content

Logger

Represents a logger utility for logging messages with various log levels.

Constructors

new Logger(options)

1
new Logger(options: LoggerOptions): Logger

Constructs a new Logger instance with the provided options.

Parameters

ParameterTypeDescription
optionsLoggerOptionsThe options for configuring the logger.

Returns

Logger

Source

seyfert/src/common/it/logger.ts:66

Properties

PropertyModifierTypeDescription
optionsreadonlyRequired<LoggerOptions>The options for configuring the logger.
DEFAULT_OPTIONSstaticRequired<LoggerOptions>The default options for the logger.
colorFunctionsstaticMap<LogLevels, (str: string) => string>A map containing color functions for different log levels.
dirnamestaticstring-
prefixesstaticMap<LogLevels, string>A map containing prefixes for different log levels.
saveOnFile?staticstring[] | "all"-
streamsstaticPartial<Record<string, WriteStream>>-

Accessors

active

1
get active(): boolean

Gets whether the logger is active or not.

1
set active(active: boolean): void

Sets whether the logger is active or not.

Parameters

ParameterType
activeboolean

Returns

boolean

Source

seyfert/src/common/it/logger.ts:102


level

1
get level(): LogLevels

Gets the log level of the logger.

1
set level(level: LogLevels): void

Sets the log level of the logger.

Parameters

ParameterType
levelLogLevels

Returns

LogLevels

Source

seyfert/src/common/it/logger.ts:80


name

1
get name(): string

Gets the name of the logger.

1
set name(name: string): void

Sets the name of the logger.

Parameters

ParameterType
namestring

Returns

string

Source

seyfert/src/common/it/logger.ts:116


saveOnFile

1
get saveOnFile(): boolean
1
set saveOnFile(saveOnFile: boolean): void

Parameters

ParameterType
saveOnFileboolean

Returns

boolean

Source

seyfert/src/common/it/logger.ts:88

Methods

debug()

1
debug(...args: any[]): void

Logs a debug message.

Parameters

ParameterTypeDescription
argsany[]The arguments to log.

Returns

void

Source

seyfert/src/common/it/logger.ts:154


error()

1
error(...args: any[]): void

Logs an error message.

Parameters

ParameterTypeDescription
argsany[]The arguments to log.

Returns

void

Source

seyfert/src/common/it/logger.ts:178


fatal()

1
fatal(...args: any[]): void

Logs a fatal error message.

Parameters

ParameterTypeDescription
argsany[]The arguments to log.

Returns

void

Source

seyfert/src/common/it/logger.ts:186


info()

1
info(...args: any[]): void

Logs an info message.

Parameters

ParameterTypeDescription
argsany[]The arguments to log.

Returns

void

Source

seyfert/src/common/it/logger.ts:162


rawLog()

1
rawLog(level: LogLevels, ...args: unknown[]): void

Logs a message with the specified log level.

Parameters

ParameterTypeDescription
levelLogLevelsThe log level.
argsunknown[]The arguments to log.

Returns

void

The logged message.

Source

seyfert/src/common/it/logger.ts:126


warn()

1
warn(...args: any[]): void

Logs a warning message.

Parameters

ParameterTypeDescription
argsany[]The arguments to log.

Returns

void

Source

seyfert/src/common/it/logger.ts:170


clearLogs()

1
static clearLogs(): Promise<void>

Returns

Promise<void>

Source

seyfert/src/common/it/logger.ts:54


customize()

1
static customize(cb: CustomCallback): void

Allows customization of the logging behavior by providing a custom callback function.

Parameters

ParameterTypeDescription
cbCustomCallbackThe custom callback function for logging.

Returns

void

Example

1
Logger.customize((logger, level, args) => {
2
// Custom logging implementation
3
});

Source

seyfert/src/common/it/logger.ts:50


noColor()

1
static noColor(msg: string): string

A function that returns the input string as is, without any color modification.

Parameters

ParameterTypeDescription
msgstringThe message to log.

Returns

string

The input message as is.

Source

seyfert/src/common/it/logger.ts:220