Home Manual Reference Source
public class | source

Logger

Simple logger implementation

Constructor Summary

Public Constructor
public

constructor(logLevel: string)

Create a Logger instance

Member Summary

Public Members
public get

Get the current log level

public set

logLevel(value: string)

Set the current log level

Method Summary

Public Methods
public

debug(message: string)

Log a debug message

public

error(message: string)

Log an error message

public

Get available log levels

public

info(message: string)

Log an informative message

public

log(message: string, level: string)

Log a message

public

warn(message: string)

Log a warning message

Public Constructors

public constructor(logLevel: string) source

Create a Logger instance

Params:

NameTypeAttributeDescription
logLevel string
  • optional
  • default: warn

Log level

Public Members

public get logLevel: string: * source

Get the current log level

Return:

string

log level

public set logLevel(value: string) source

Set the current log level

Throw:

getLogLevels

Public Methods

public debug(message: string) source

Log a debug message

Params:

NameTypeAttributeDescription
message string

Message to be logged

public error(message: string) source

Log an error message

Params:

NameTypeAttributeDescription
message string

Message to be logged

public getLogLevels(): Array<string> source

Get available log levels

Return:

Array<string>

Log levels

public info(message: string) source

Log an informative message

Params:

NameTypeAttributeDescription
message string

Message to be logged

public log(message: string, level: string) source

Log a message

Params:

NameTypeAttributeDescription
message string

Message to be logged

level string

Log level

public warn(message: string) source

Log a warning message

Params:

NameTypeAttributeDescription
message string

Message to be logged