Home Manual Reference Source
import Logger from 'ievv_jsbase/lib/log/Logger'
public class | source

Logger

Extends:

AbstractLogger → Logger

Constructor Summary

Public Constructor
public

constructor(name: string, loggerSingleton: LoggerSingleton)

Member Summary

Public Members
public get

name: string: *

Get the name of this logger.

Method Summary

Public Methods
public
public

getLogLevel(): int

Get the log level.

public

Get textual name for the log level.

public

setLogLevel(logLevel: int)

Set the loglevel for this logger.

Inherited Summary

From class AbstractLogger
public get

Exposes console.log.

public get

Exposes console.error.

public get

Exposes console.log.

public get

isDebug: *

Returns true if loglevel is higher than or equal to LogLevels#DEBUG.

public get

isError: *

Returns true if loglevel is higher than or equal to LogLevels#ERROR.

public get

isInfo: *

Returns true if loglevel is higher than or equal to LogLevels#INFO.

public get

Returns true if loglevel is higher than or equal to LogLevels#WARNING.

public get

Exposes console.warn.

public

Public Constructors

public constructor(name: string, loggerSingleton: LoggerSingleton) source

Params:

NameTypeAttributeDescription
name string

The name of the logger.

loggerSingleton LoggerSingleton

The logger singleton this logger belongs to.

Public Members

public get name: string: * source

Get the name of this logger.

Return:

string

Public Methods

public getDebugInfoString(): string source

Return:

string

public getLogLevel(): int source

Get the log level.

If no log level has been set with Logger#setLogLevel, this returns LoggerSingleton#getDefaultLogLevel.

Override:

AbstractLogger#getLogLevel

Return:

int

public getTextualNameForLogLevel(): string source

Get textual name for the log level. If the logger does not have a logLevel (if it inherits it from the LoggerSingleton) a string with information about this and the default logLevel for the LoggerSingleton is returned.

Intended for debugging. The format of the string may change.

Return:

string

public setLogLevel(logLevel: int) source

Set the loglevel for this logger.

Params:

NameTypeAttributeDescription
logLevel int

The log level. Must be one of the loglevels defined in LogLevels.

Throw:

RangeError

if LogLevels#validateLogLevel fails.