1 logger
ztimson edited this page 2024-09-22 03:11:09 -04:00

@ztimson/utils / logger

logger

Enumerations

LOG_LEVEL

Enumeration Members

DEBUG

DEBUG: 4

Defined in

src/logger.ts:49

ERROR

ERROR: 0

Defined in

src/logger.ts:45

INFO

INFO: 2

Defined in

src/logger.ts:47

LOG

LOG: 3

Defined in

src/logger.ts:48

WARN

WARN: 1

Defined in

src/logger.ts:46

Classes

Logger

Extends

Constructors

new Logger()

new Logger(namespace?): Logger

Parameters

namespace?: string

Returns

Logger

Overrides

TypedEmitter.constructor

Defined in

src/logger.ts:63

Properties

namespace?

readonly optional namespace: string

Defined in

src/logger.ts:63

LOG_LEVEL

static LOG_LEVEL: LOG_LEVEL = LOG_LEVEL.DEBUG

Defined in

src/logger.ts:61

Methods

debug()

debug(...args): void

Parameters

• ...args: string[]

Returns

void

Defined in

src/logger.ts:81

emit()

emit<K>(event, ...args): void

Type Parameters

K extends string | symbol

Parameters

event: K

• ...args: Parameters<LoggerEvents[K]>

Returns

void

Inherited from

TypedEmitter.emit

Defined in

src/emitter.ts:36

error()

error(...args): void

Parameters

• ...args: string[]

Returns

void

Defined in

src/logger.ts:109

info()

info(...args): void

Parameters

• ...args: string[]

Returns

void

Defined in

src/logger.ts:95

log()

log(...args): void

Parameters

• ...args: string[]

Returns

void

Defined in

src/logger.ts:88

off()

off<K>(event, listener): void

Type Parameters

K extends string | symbol = string

Parameters

event: K

listener: LoggerEvents[K]

Returns

void

Inherited from

TypedEmitter.off

Defined in

src/emitter.ts:41

on()

on<K>(event, listener): () => void

Type Parameters

K extends string | symbol = string

Parameters

event: K

listener: LoggerEvents[K]

Returns

Function

Returns

void

Inherited from

TypedEmitter.on

Defined in

src/emitter.ts:45

once()

once<K>(event, listener?): Promise<any>

Type Parameters

K extends string | symbol = string

Parameters

event: K

listener?: LoggerEvents[K]

Returns

Promise<any>

Inherited from

TypedEmitter.once

Defined in

src/emitter.ts:51

warn()

warn(...args): void

Parameters

• ...args: string[]

Returns

void

Defined in

src/logger.ts:102

emit()

static emit(event, ...args): void

Parameters

event: any

• ...args: any[]

Returns

void

Inherited from

TypedEmitter.emit

Defined in

src/emitter.ts:9

off()

static off(event, listener): void

Parameters

event: any

listener: Listener

Returns

void

Inherited from

TypedEmitter.off

Defined in

src/emitter.ts:14

on()

static on(event, listener): () => void

Parameters

event: any

listener: Listener

Returns

Function

Returns

void

Inherited from

TypedEmitter.on

Defined in

src/emitter.ts:19

once()

static once(event, listener?): Promise<any>

Parameters

event: any

listener?: Listener

Returns

Promise<any>

Inherited from

TypedEmitter.once

Defined in

src/emitter.ts:26

Type Aliases

LoggerEvents

LoggerEvents: TypedEvents & object

Type declaration

DEBUG()

DEBUG: (...args) => any

Parameters

• ...args: any[]

Returns

any

ERROR()

ERROR: (...args) => any

Parameters

• ...args: any[]

Returns

any

INFO()

INFO: (...args) => any

Parameters

• ...args: any[]

Returns

any

LOG()

LOG: (...args) => any

Parameters

• ...args: any[]

Returns

any

WARN()

WARN: (...args) => any

Parameters

• ...args: any[]

Returns

any

Defined in

src/logger.ts:52

Variables

CliBackground

const CliBackground: object

Type declaration

BLACK

BLACK: string = "\x1b[40m"

BLUE

BLUE: string = "\x1b[44m"

CYAN

CYAN: string = "\x1b[46m"

GREEN

GREEN: string = "\x1b[42m"

GREY

GREY: string = "\x1b[100m"

MAGENTA

MAGENTA: string = "\x1b[45m"

RED

RED: string = "\x1b[41m"

WHITE

WHITE: string = "\x1b[47m"

YELLOW

YELLOW: string = "\x1b[43m"

Defined in

src/logger.ts:32


CliEffects

const CliEffects: object

Type declaration

BLINK: string = "\x1b[5m"

BRIGHT

BRIGHT: string = "\x1b[1m"

CLEAR

CLEAR: string = "\x1b[0m"

DIM

DIM: string = "\x1b[2m"

HIDDEN

HIDDEN: string = "\x1b[8m"

REVERSE

REVERSE: string = "\x1b[7m"

UNDERSCORE

UNDERSCORE: string = "\x1b[4m"

Defined in

src/logger.ts:3


CliForeground

const CliForeground: object

Type declaration

BLACK

BLACK: string = '\x1b[30m'

BLUE

BLUE: string = '\x1b[34m'

CYAN

CYAN: string = '\x1b[36m'

GREEN

GREEN: string = '\x1b[32m'

GREY

GREY: string = '\x1b[90m'

LIGHT_BLUE

LIGHT_BLUE: string = '\x1b[94m'

LIGHT_CYAN

LIGHT_CYAN: string = '\x1b[96m'

LIGHT_GREEN

LIGHT_GREEN: string = '\x1b[92m'

LIGHT_GREY

LIGHT_GREY: string = '\x1b[37m'

LIGHT_MAGENTA

LIGHT_MAGENTA: string = '\x1b[95m'

LIGHT_RED

LIGHT_RED: string = '\x1b[91m'

LIGHT_YELLOW

LIGHT_YELLOW: string = '\x1b[93m'

MAGENTA

MAGENTA: string = '\x1b[35m'

RED

RED: string = '\x1b[31m'

WHITE

WHITE: string = '\x1b[97m'

YELLOW

YELLOW: string = '\x1b[33m'

Defined in

src/logger.ts:13