LogLevels
Defines valid log levels.
Not used directly, but instead via the LOGLEVEL constant exported as default by this module.
Example:
import LOGLEVEL from 'ievv_jsbase/log/loglevel';
console.log('The debug loglevel is:', LOGLEVEL.DEBUG);
LOGLEVEL.validateLogLevel(10);
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public get |
Get the number for log level DEBUG. |
|
| public get |
Get the number for log level ERROR. |
|
| public get |
Get the number for log level INFO. |
|
| public get |
Get the number for log level SILENT. |
|
| public get |
Get the number for log level WARNING. |
|
Method Summary
| Public Methods | ||
| public |
getTextualNameForLogLevel(logLevel: number): string Get the textual name for a log level. |
|
| public |
validateLogLevel(logLevel: *) Validate a log level. |
|
Public Constructors
public constructor source
Public Members
Public Methods
public getTextualNameForLogLevel(logLevel: number): string source
Get the textual name for a log level.
Params:
| Name | Type | Attribute | Description |
| logLevel | number | The log level to get a textual name for. |
Example:
const infoText = LOGLEVEL.getTextualNameForLogLevel(LOGLEVEL.INFO);
// infoText === 'INFO'
public validateLogLevel(logLevel: *) source
Validate a log level.
Should be used by all functions/methods that set a log level.
Params:
| Name | Type | Attribute | Description |
| logLevel | * | The loglevel. |
Throw:
If |