SkylinkLogger

SkylinkLogger

Class used for logging messages on the console. Exports a singleton logger object.

Constructor

new SkylinkLogger()

Source:
Example
import { SkylinkLogger } from 'skylinkjs';

SkylinkLogger.setLevel(SkylinkLogger.logLevels.DEBUG);

Members

logLevels :Object

Description:
  • List of log levels.

Source:
Properties:
Name Type Description
TRACE number

All logs.

DEBUG number
INFO number
WARN number
ERROR number
SILENT number

No logs.

List of log levels.

Type:
  • Object

storeLogs :boolean

Description:
  • The flag that enables the store logs function.

Source:

The flag that enables the store logs function.

Type:
  • boolean

storedLogs :Array.<logItems>

Description:
  • The stored logs when storeLogs flag is set to true.

Source:

The stored logs when storeLogs flag is set to true.

Type:

Methods

disableAll()

Description:
  • Disables all logging with lowest level (SILENT).

Source:

enableAll()

Description:
  • Enables logging with highest level (TRACE).

Source:

setLevel(level, storeLogs)

Description:
  • Method that sets the log level.

Source:
Example
skylinkLogger.setLogLevels(skylinkLogger.logLevels.TRACE);
Parameters:
Name Type Description
level number

The log level to be set. REF: logLevels

storeLogs Boolean

The flag if logs should be stored.