Skip to content

Logger.default

km127pl edited this page Aug 13, 2023 · 1 revision

Class: default

Logger.default

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new default(name)

Parameters

Name Type
name string

Defined in

Logger.ts:4

Properties

name

Private Readonly name: string

Defined in

Logger.ts:2


ansi

Static Readonly ansi: Readonly<{ background: { black: string = "\x1b[40m"; blue: string = "\x1b[44m"; bright: { black: string = "\x1b[40;1m"; blue: string = "\x1b[44;1m"; cyan: string = "\x1b[46;1m"; green: string = "\x1b[42;1m"; magenta: string = "\x1b[45;1m"; red: string = "\x1b[41;1m"; white: string = "\x1b[47;1m"; yellow: string = "\x1b[43;1m" } ; cyan: string = "\x1b[46m"; green: string = "\x1b[42m"; magenta: string = "\x1b[45m"; red: string = "\x1b[41m"; white: string = "\x1b[47m"; yellow: string = "\x1b[43m" } ; format: { blink: string = "\x1b[5m"; bold: string = "\x1b[1m"; dim: string = "\x1b[2m"; hidden: string = "\x1b[8m"; reset: string = "\x1b[0m"; reverse: string = "\x1b[7m"; underline: string = "\x1b[4m" } ; text: { black: string = "\x1b[30m"; blue: string = "\x1b[34m"; bright: { black: string = "\x1b[30;1m"; blue: string = "\x1b[34;1m"; cyan: string = "\x1b[36;1m"; green: string = "\x1b[32;1m"; magenta: string = "\x1b[35;1m"; red: string = "\x1b[31;1m"; white: string = "\x1b[37;1m"; yellow: string = "\x1b[33;1m" } ; cyan: string = "\x1b[36m"; green: string = "\x1b[32m"; magenta: string = "\x1b[35m"; red: string = "\x1b[31m"; white: string = "\x1b[37m"; yellow: string = "\x1b[33m" } }>

ANSI escape codes

Defined in

Logger.ts:83


level

Static Readonly level: Record<string, string>

Level formatting

Defined in

Logger.ts:138

Methods

debug

debug(message, ...obj?): void

Log debug message

Parameters

Name Type Description
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:76


error

error(message, ...obj?): void

Log error message

Parameters

Name Type Description
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:58


format

Private format(level, message): string

Format string with log level and prefix

Parameters

Name Type Description
level Level Log level
message string Message to format

Returns

string

Defined in

Logger.ts:21


info

info(message, ...obj?): void

Log info message

Parameters

Name Type Description
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:40


log

log(level, message, ...obj?): void

Log message

Parameters

Name Type Description
level Level Log level
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:31


send

Private send(...obj): void

Print object without any log level

Parameters

Name Type Description
...obj any[] Object to print

Returns

void

Defined in

Logger.ts:12


success

success(message, ...obj?): void

Log success message

Parameters

Name Type Description
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:67


warn

warn(message, ...obj?): void

Log warning message

Parameters

Name Type Description
message string Message to log
...obj? any[] Objects to print

Returns

void

Defined in

Logger.ts:49


background256

Static background256(colour): string

256 colors

Parameters

Name Type Description
colour number Colour ID from 0 to 255

Returns

string

Defined in

Logger.ts:158


backgroundRGB

Static backgroundRGB(red, green, blue): string

RGB colors

Parameters

Name Type Description
red number Red value from 0 to 255
green number Green value from 0 to 255
blue number Blue value from 0 to 255

Returns

string

Defined in

Logger.ts:178


text256

Static text256(colour): string

256 colors

Parameters

Name Type Description
colour number Colour ID from 0 to 255

Returns

string

Defined in

Logger.ts:150


textRGB

Static textRGB(red, green, blue): string

RGB colors

Parameters

Name Type Description
red number Red value from 0 to 255
green number Green value from 0 to 255
blue number Blue value from 0 to 255

Returns

string

Defined in

Logger.ts:168

Clone this wiki locally