LogLevel enum

Log level enum for categorizing log messages by severity. Levels from least to most severe: debug, info, warning, error, critical.

Example

// Compare severity
if (LogLevel.error > LogLevel.warning) {
  print('Error is more severe');
}

// Use in logger
final logger = ConsoleLogger(minLevel: LogLevel.warning);
logger.log(LogLevel.debug, 'Hidden');
logger.log(LogLevel.error, 'Visible');

// Access severity
print('Error severity: ${LogLevel.error.severity}');
Inheritance
Available extensions

Values

debug → const LogLevel

Debug-level diagnostic messages.

const LogLevel(0)
info → const LogLevel

Informational messages about normal operations.

const LogLevel(1)
warning → const LogLevel

Warning messages for potentially problematic situations.

const LogLevel(2)
error → const LogLevel

Error messages for failures that allow continued execution.

const LogLevel(3)
critical → const LogLevel

Critical errors requiring immediate attention.

const LogLevel(4)

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
severity int
Severity level (higher = more severe).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator <(LogLevel other) bool
Checks if this level is less severe than another.
operator <=(LogLevel other) bool
Checks if this level is less severe or equal to another.
operator ==(Object other) bool
The equality operator.
inherited
operator >(LogLevel other) bool
Checks if this level is more severe than another.
operator >=(LogLevel other) bool
Checks if this level is more severe or equal to another.

Constants

values → const List<LogLevel>
A constant List of the values in this enum, in order of their declaration.