Class: ConsoleLogger
ConsoleLogger
Extends
Constructors
new ConsoleLogger(output, level, format)
new ConsoleLogger(
output
,level
?,format
?):ConsoleLogger
Parameters
• output: WorkerOutput
• level?: WorkerLogLevel
• format?: string
= ConsoleLogger.defaultFormat
Returns
Overrides
Source
Properties
format
format:
string
Source
level
level:
WorkerLogLevel
Inherited from
Source
listener
listener: (
msg
) =>void
Parameters
• msg: WorkerMessage
Returns
void
Inherited from
Source
output
output:
WorkerOutput
Inherited from
Source
defaultFormat
static
defaultFormat:string
="%(d)s [%(l)s] %(m)s"
Source
Methods
close()
close():
void
Close the listener
Returns
void
Inherited from
Source
onMessage()
onMessage(
msg
):void
Parameters
• msg: WorkerMessage
Returns
void
Overrides
Source
display()
static
display(msg
,format
):void
Display a message to the console
Parameters
• msg: WorkerMessage
• format: string
= ConsoleLogger.defaultFormat
Returns
void
Source
format()
static
format(msg
,format
):string
Format a log based on format string
Parameters
• msg: WorkerMessage
• format: string
= ConsoleLogger.defaultFormat
Returns
string
Source
getColor()
static
getColor(level
): (s
) =>string
Parameters
• level: WorkerLogLevel
to get color from
Returns
Function
Parameters
• s:
string
Returns
string
Source
handleMessage()
static
handleMessage(msg
,level
,format
):void
Commonly handle a message
Parameters
• msg: WorkerMessage
• level: WorkerLogLevel
• format: string
= ConsoleLogger.defaultFormat
Returns
void