Level class final
Severity level of the record used to controls output of particular logger.
There are 5 predefined levels: Level.fatal, Level.error, Level.warn, Level.info and Level.debug (sorted in ascending order by their values).
To prevent logger from emitting any records set Logger.level to Level.off.
To emit records with any severity level by logger set Logger.level to Level.all.
User-defined severity levels are also supported. Use Level constructor
to define a new severity level. Make sure that defined level's
unique value is between 0x0
(Level.all) and 0xffff
(Level.off);
and does not overlap with 0x100
, 0x200
, 0x300
, 0x400
, 0x500
and
0x600
reserved for debug, info, warn, error and fatal
levels respectively.
- Implemented types
Properties
Methods
-
compareTo(
Level otherLevel) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator <(
Level otherLevel) → bool -
operator <=(
Level otherLevel) → bool -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Level otherLevel) → bool -
operator >=(
Level otherLevel) → bool
Constants
- all → const Level
- Special level value used to allow records with any severity level to be emitted by logger.
- debug → const Level
- A severity level for debugging records; often records with debug level used to provide diagnostic information useful in development, testing, etc., such records are usually discarded in production.
- error → const Level
- A severity level for error records; often records with the error level used to notify about fatal error in the operation without impact on the stability of a service or an application.
- fatal → const Level
-
A severity level for fatal records; often after records with fatal
severity level follows application process end e.g.
exit(1)
. - info → const Level
- A severity level for informative records; often records with info level used to provide general purpose information such as start/stop of service, etc.
- off → const Level
- Special level value to disable logger output.
- warn → const Level
- A severity level for warn records; often records with the warn level used to notify about events that may potentially cause application oddities.