Module: logLevelUtils

Methods

(inner) formatTime(h, m, s) → {string}

Formats hours, minutes and seconds into one time string, padding left with zeros if necessary

Parameters:
Name Type Description
h number

number representing hours

m number

number representing minutes

s number

number representing seconds

Source:
Returns:

formatted time

Type
string

(async, inner) getConsoleGuard()

Source:
Returns:

the guard (@see {@ link getGuard}) based on the console-config

(inner) getGuard(level)

Parameters:
Name Type Description
level

a min-level provided in the log-config

Source:
Returns:

an approproate function/guard that accepts all logs with a level over level If the log level is not valid, a guard is returned which accepts all logs

(async, inner) getWriterGuard()

Source:
Returns:

the guard (@see {@ link getGuard}) based on the writer-config

(inner) isSmaller(should, another) → {boolean}

Parameters:
Name Type Description
should string

a log level that is expected

another string

log level

Source:
Returns:

whether or not current is smaller than should

Type
boolean

(inner) meetsMinLevel(should)

Parameters:
Name Type Description
should string

a log level (later the minLevel specified in the log-config)

Source:
Returns:

a function, returning whether or not a passed log-level is at least the level specified in the config

(inner) validLogType(type) → {boolean}

Checks if the provided value is a valid log level

Parameters:
Name Type Description
type string

any string that is to be checked

Source:
Returns:

whether or not type is a logtype (i.e. debug, info, warn...)

Type
boolean