Class: Logger
The logger class.
Since
1.0.0
Extends
Logger
Constructors
new Logger()
new Logger(
options
:LoggerOptions
):Logger
Parameters
Parameter | Type |
---|---|
options | LoggerOptions |
Returns
Overrides
BuiltinLogger.constructor
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:36
Properties
console
readonly
console:Console
The console this writes to.
Since
1.0.0
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:16
depth
readonly
depth:number
The inspect depth when logging objects.
Since
1.0.0
Defined in
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
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:22
join
readonly
join:string
The string write
will join values by.
Since
1.0.0
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:28
level
level:
LogLevel
Inherited from
BuiltinLogger.level
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3720
levels
protected
readonly
static
levels:Map
<LogLevel
,LogMethods
>
Inherited from
BuiltinLogger.levels
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3730
Accessors
levels
Get Signature
get
private
levels():Map
<LogLevel
,LogMethods
>
Returns
Map
<LogLevel
, LogMethods
>
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:69
stylize
Get Signature
get
static
stylize():boolean
Gets whether or not colorette is enabled.
Since
1.0.0
Returns
boolean
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:77
Methods
debug()
debug(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Debug as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.debug
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3724
error()
error(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Error as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.error
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3727
fatal()
fatal(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Fatal as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.fatal
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3728
has()
has(
level
:LogLevel
):boolean
Checks whether a level is supported.
Parameters
Parameter | Type | Description |
---|---|---|
level | LogLevel | The level to check. |
Returns
boolean
Inherited from
BuiltinLogger.has
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3722
info()
info(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Info as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.info
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3725
preprocess()
protected
preprocess(values
: readonlyunknown
[]):string
Pre-processes an array of values.
Parameters
Parameter | Type | Description |
---|---|---|
values | readonly unknown [] | The values to pre-process. |
Returns
string
Since
1.0.0
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:64
trace()
trace(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Trace as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.trace
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3723
warn()
warn(...
values
: readonlyunknown
[]):void
Alias of ILogger.write with LogLevel.Warn as level.
Parameters
Parameter | Type | Description |
---|---|---|
...values | readonly unknown [] | The values to log. |
Returns
void
Inherited from
BuiltinLogger.warn
Defined in
node_modules/@sapphire/framework/dist/esm/index.d.mts:3726
write()
write(
level
:LogLevel
, ...values
: readonlyunknown
[]):void
Writes the log message given a level and the value(s).
Parameters
Parameter | Type | Description |
---|---|---|
level | LogLevel | The log level. |
...values | readonly unknown [] | The values to log. |
Returns
void
Overrides
BuiltinLogger.write
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:50
createFormatMap()
private
static
createFormatMap(options
:LoggerFormatOptions
,defaults
:LoggerLevelOptions
):Map
<LogLevel
,LoggerLevel
>
Parameters
Parameter | Type |
---|---|
options | LoggerFormatOptions |
defaults | LoggerLevelOptions |
Returns
Map
<LogLevel
, LoggerLevel
>
Defined in
projects/plugins/packages/logger/src/lib/Logger.ts:81
ensureDefaultLevel()
private
static
ensureDefaultLevel(options
:undefined
|LoggerLevelOptions
,defaults
:LoggerLevelOptions
,color
:Color
,name
:string
):LoggerLevel
Parameters
Parameter | Type |
---|---|
options | undefined | LoggerLevelOptions |
defaults | LoggerLevelOptions |
color | Color |
name | string |