Skip to main content

Class: Logger

The logger class.

Since

1.0.0

Extends

  • Logger

Constructors

new Logger()

new Logger(options: LoggerOptions): Logger

Parameters

ParameterType
optionsLoggerOptions

Returns

Logger

Overrides

BuiltinLogger.constructor

Source

projects/plugins/packages/logger/src/lib/Logger.ts:36

Properties

console

readonly console: Console

The console this writes to.

Since

1.0.0

Source

projects/plugins/packages/logger/src/lib/Logger.ts:16


depth

readonly depth: number

The inspect depth when logging objects.

Since

1.0.0

Source

projects/plugins/packages/logger/src/lib/Logger.ts:34


formats

readonly formats: Map<LogLevel, LoggerLevel>

The formats supported by the logger.

Since

1.0.0

Source

projects/plugins/packages/logger/src/lib/Logger.ts:22


join

readonly join: string

The string write will join values by.

Since

1.0.0

Source

projects/plugins/packages/logger/src/lib/Logger.ts:28


level

level: LogLevel

Inherited from

BuiltinLogger.level

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3718


levels

protected static readonly levels: Map<LogLevel, LogMethods>

Inherited from

BuiltinLogger.levels

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3728

Accessors

levels

get private levels(): Map<LogLevel, LogMethods>

Returns

Map<LogLevel, LogMethods>

Source

projects/plugins/packages/logger/src/lib/Logger.ts:69


stylize

get static stylize(): boolean

Gets whether or not colorette is enabled.

Since

1.0.0

Returns

boolean

Source

projects/plugins/packages/logger/src/lib/Logger.ts:77

Methods

debug()

debug(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.debug

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3722


error()

error(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.error

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3725


fatal()

fatal(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.fatal

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3726


has()

has(level: LogLevel): boolean

Parameters

ParameterType
levelLogLevel

Returns

boolean

Inherited from

BuiltinLogger.has

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3720


info()

info(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.info

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3723


preprocess()

protected preprocess(values: readonly unknown[]): string

Pre-processes an array of values.

Parameters

ParameterTypeDescription
valuesreadonly unknown[]The values to pre-process.

Returns

string

Since

1.0.0

Source

projects/plugins/packages/logger/src/lib/Logger.ts:64


trace()

trace(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.trace

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3721


warn()

warn(...values: readonly unknown[]): void

Parameters

ParameterType
...valuesreadonly unknown[]

Returns

void

Inherited from

BuiltinLogger.warn

Source

node_modules/@sapphire/framework/dist/esm/index.d.mts:3724


write()

write(level: LogLevel, ...values: readonly unknown[]): void

Writes the log message given a level and the value(s).

Parameters

ParameterTypeDescription
levelLogLevelThe log level.
...valuesreadonly unknown[]The values to log.

Returns

void

Overrides

BuiltinLogger.write

Source

projects/plugins/packages/logger/src/lib/Logger.ts:50


createFormatMap()

private static createFormatMap(options: LoggerFormatOptions, defaults: LoggerLevelOptions): Map<LogLevel, LoggerLevel>

Parameters

ParameterType
optionsLoggerFormatOptions
defaultsLoggerLevelOptions

Returns

Map<LogLevel, LoggerLevel>

Source

projects/plugins/packages/logger/src/lib/Logger.ts:81


ensureDefaultLevel()

private static ensureDefaultLevel(options: undefined | LoggerLevelOptions, defaults: LoggerLevelOptions, color: Color, name: string): LoggerLevel

Parameters

ParameterType
optionsundefined | LoggerLevelOptions
defaultsLoggerLevelOptions
colorColor
namestring

Returns

LoggerLevel

Source

projects/plugins/packages/logger/src/lib/Logger.ts:93