For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
Level
struct Level
Represents logging severity levels.
Defines the available logging levels in ascending order of severity.
Implemented traits
AnyType,
Comparable,
Copyable,
Equatable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
Writable
comptime members
CRITICAL
comptime CRITICAL = Level(60)
A serious error indicating that the program itself may be unable to continue running.
DEBUG
comptime DEBUG = Level(20)
Detailed information, typically of interest only when diagnosing problems.
ERROR
comptime ERROR = Level(50)
Due to a more serious problem, the software has not been able to perform some function.
INFO
comptime INFO = Level(30)
Confirmation that things are working as expected.
NOTSET
comptime NOTSET = Level(0)
Lowest level, used when no level is set.
TRACE
comptime TRACE = Level(10)
Repetitive trace information, Indicates repeated execution or IO-coupled activity, typically only of interest when diagnosing hangs or ensuring a section of code is executing.
WARNING
comptime WARNING = Level(40)
Indication that something unexpected happened, or may happen in the near future.
Methods
__lt__
def __lt__(self, other: Self) -> Bool
Returns True if this level is less than the other level.
Args:
- other (
Self): The level to compare with.
Returns:
Bool: Bool: True if this level is less than the other level, False otherwise.
__eq__
def __eq__(self, other: Self) -> Bool
Returns True if this level equals the other level.
Args:
- other (
Self): The level to compare with.
Returns:
Bool: Bool: True if the levels are equal, False otherwise.
color
def color(self) -> Color
Returns the ANSI color of the level.
Returns:
Color: The corresponding Color of the level.
write_to
def write_to(self, mut writer: T)
Writes the string representation of this level to a writer.
Args:
- writer (
T): The writer to write to.