Home Manual Reference Source Test Repository
public class | source

Logger

Class for configuring logging.

Static Method Summary

Static Private Methods
private static

Check if the message is empty and replace it with the meta.

private static

Formatter function which formats the output to the console.

private static

Function to create a global logger object based on the properties of the Logger class.

private static

Formatter function which formate the output to the log file.

private static

Get the color of the output based on the log level.

Constructor Summary

Public Constructor
public

constructor(verbose: Boolean, debug: Boolean)

Create a logger object.

Static Private Methods

private static _checkEmptyMessage(args: Object): Object source

Check if the message is empty and replace it with the meta.

Params:

NameTypeAttributeDescription
args Object

Arguments passed by Winston.

Return:

Object

Formatter arguments passed by Winston.

private static _consoleFormatter(args: Object): String source

Formatter function which formats the output to the console.

Params:

NameTypeAttributeDescription
args Object

Arguments passed by Winston.

Return:

String

The formatted message.

private static _createLogger() source

Function to create a global logger object based on the properties of the Logger class.

private static _fileFormatter(args: Object): String source

Formatter function which formate the output to the log file.

Params:

NameTypeAttributeDescription
args Object

Arguments passed by Winston.

Return:

String

The formatted message.

private static _getLevelColor(level: String): String source

Get the color of the output based on the log level.

Params:

NameTypeAttributeDescription
level String

The log level.

Return:

String

A color based on the log level.

Public Constructors

public constructor(verbose: Boolean, debug: Boolean) source

Create a logger object.

Params:

NameTypeAttributeDescription
verbose Boolean
  • optional
  • nullable: true

Debug mode for no output.

debug Boolean
  • optional
  • nullable: true

Debug mode for extra output.