Class

module:Logger

module:Logger(optionsopt)

Logger used on top of console

Constructor

# new module:Logger(optionsopt)

Parameters:
Name Type Attributes Description
options Logger~InitOptions <optional>

The initialization options of the Logger

View Source global/Logger.js, line 34

Example
const logger = new Logger({ prefix: "@ " });
logger.log("hi, world");

Members

# hasColors

Colors is used to control whether the log should have colors or not

View Source global/Logger.js, line 91

# prefix

Prefix is used at the beginning of the log

View Source global/Logger.js, line 79

# separator

Separator is the string that separates the date from the log message

View Source global/Logger.js, line 85

Methods

# enableColors(enableopt) → {void}

Used to enable or disable colors in log messages

Parameters:
Name Type Attributes Default Description
enable boolean <optional>
true

Enable colors?

View Source global/Logger.js, line 72

void

# error(message, optionsopt) → {void}

Equivalent of console.error with various options

Parameters:
Name Type Attributes Description
message string

The message to log

options Logger~BuildOptions <optional>

Build options

View Source global/Logger.js, line 177

void

# info(message, optionsopt) → {void}

Equivalent of console.info with various options

Parameters:
Name Type Attributes Description
message string

The message to log

options Logger~BuildOptions <optional>

Build options

View Source global/Logger.js, line 157

void

# log(message, optionsopt) → {void}

Equivalent of console.log with various options

Parameters:
Name Type Attributes Description
message string

The message to log

options Logger~BuildOptions <optional>

Build options

View Source global/Logger.js, line 147

void

# setPrefix(prefix) → {void}

Changes the prefix

Parameters:
Name Type Description
prefix string

The new prefix

View Source global/Logger.js, line 54

void

# setSeparator(separator) → {void}

Changes the separator

Parameters:
Name Type Description
separator string

The new separator

View Source global/Logger.js, line 63

void

# warn(message, optionsopt) → {void}

Equivalent of console.warn with various options

Parameters:
Name Type Attributes Description
message string

The message to log

options Logger~BuildOptions <optional>

Build options

View Source global/Logger.js, line 167

void