Level
@codification/cutwater-logging > Level
Class
Defines a set of standard logging levels that can be used to control logging output. The logging Level objects are ordered and are specified by ordered integers. Enabling logging at a given level also enables logging at all higher levels.
beta:
Hierarchy
Level
Properties
Accessors
Methods
Properties
<Static>
ALL
● ALL: Level = new Level('ALL', 7)
Defined in Level.ts:48
Level indicating that ALL messages will be output.
readonly:
<Static>
DEBUG
● DEBUG: Level = new Level('DEBUG', 5)
Defined in Level.ts:38
Level indicating only debug messages or worse will be output.
readonly:
<Static>
ERROR
● ERROR: Level = new Level('ERROR', 2)
Defined in Level.ts:23
Level indicating only error messages or worse will be output.
readonly:
<Static>
FATAL
● FATAL: Level = new Level('FATAL', 1)
Defined in Level.ts:18
Level indicating only fatal messages will be output.
readonly:
<Static>
INFO
● INFO: Level = new Level('INFO', 4)
Defined in Level.ts:33
Level indicating only info messages or worse will be output.
readonly:
<Static>
LEVELS
● LEVELS: Level[] = [ Level.FATAL, Level.ERROR, Level.WARN, Level.INFO, Level.DEBUG, Level.TRACE ]
Defined in Level.ts:54
An array containing all Levels.
readonly:
<Static>
OFF
● OFF: Level = new Level('OFF', 0)
Defined in Level.ts:13
Level inidicating all logging is disabled.
readonly:
<Static>
TRACE
● TRACE: Level = new Level('TRACE', 6)
Defined in Level.ts:43
Level indicating trace messages or worse will be output.
readonly:
<Static>
WARN
● WARN: Level = new Level('WARN', 3)
Defined in Level.ts:28
Level indicating only warning messages or worse will be output.
readonly:
Accessors
name
get name(): string
Defined in Level.ts:117
Human readable name of this Level.
readonly:
Returns: string
priority
get priority(): number
Defined in Level.ts:126
The numeric priority of this Level. Higher values indicate a higher level of detail.
readonly:
Returns: number
Methods
isGreaterOrEqual
▸ isGreaterOrEqual(level: Level): boolean
Defined in Level.ts:103
Returns true
if this Level is greater or equal to the priority of the supplied level.
Parameters:
Name | Type | Description |
---|---|---|
level | Level | the level to be compared |
Returns: boolean
true if this level is greater than the one supplied
<Static>
toLevel
▸ toLevel(level: string
| number
, defaultLevel?: Level): Level
Defined in Level.ts:78
Returns a Level object representing the string
or number
speicified.
Parameters:
Name | Type | Default value | Description | |
---|---|---|---|---|
level | string \ | number | - | a value corresponding to a Level |
Default value defaultLevel | Level | Level.ERROR |
Returns: Level the represented Level, or the defaul if it does not exist