Logger
Overview
Usage
- Node
- Deno
- Browser/ESM
import { Logger } from 'keywork/logger/classes'
import { Logger } from 'https://deno.land/x/keywork/logger/classes'
let { Logger } = await import('https://esm.sh/keywork/logger/classes')
Constructors
constructor
new Logger
(logPrefix, level?, color?)
Parameters
Name | Type | Default value |
---|---|---|
logPrefix | string | undefined |
level | LogLevel | LogLevel.Warning |
color | string | 'cyan' |
Defined in
logger/classes/Logger.ts:95
Properties
debug
debug: (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`
Type declaration
(message?, ...optionalParams): `void`
Parameters
Name | Type |
---|---|
message? | any |
...optionalParams | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:90
globalConsole
protected globalConsole: `GlobalConsoleLike`
Defined in
logger/classes/Logger.ts:87
info
info: (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`
Type declaration
(message?, ...optionalParams): `void`
Parameters
Name | Type |
---|---|
message? | any |
...optionalParams | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:92
level
protected level: `LogLevel` = `DEFAULT_LOG_LEVEL`
Defined in
logger/classes/Logger.ts:86
log
log: (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`
Type declaration
(message?, ...optionalParams): `void`
Parameters
Name | Type |
---|---|
message? | any |
...optionalParams | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:91
logPrefix
protected logPrefix: `string`
Defined in
logger/classes/Logger.ts:85
trace
trace: (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`
Type declaration
(message?, ...optionalParams): `void`
Parameters
Name | Type |
---|---|
message? | any |
...optionalParams | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:89
warn
warn: (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`
Type declaration
(message?, ...optionalParams): `void`
Parameters
Name | Type |
---|---|
message? | any |
...optionalParams | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:93
Methods
_createLogMethod
_createLogMethod
(logType, logTypeLabel, color): (...`args`: `any`[]) => `void`
Parameters
Name | Type |
---|---|
logType | keyof GlobalConsoleLike |
logTypeLabel | string |
color | string |
Returns
fn
(...args): `void`
Parameters
Name | Type |
---|---|
...args | any [] |
Returns
void
Defined in
logger/classes/Logger.ts:115
error
error
(error): `void`
Parameters
Name | Type |
---|---|
error | unknown |
Returns
void
Defined in
logger/classes/Logger.ts:128
json
json
(json): `void`
Parameters
Name | Type |
---|---|
json | Object |
Returns
void
Defined in
logger/classes/Logger.ts:137
jsonEntries
jsonEntries
jsonEntries<T>(label, json, key): `void`
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
label | string |
json | Iterable< T> |
key | keyof T |
Returns
void
Defined in
logger/classes/Logger.ts:142
A isomorphic logger available in both the browser and worker environments.