IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

TraceLevel

struct TraceLevel

An enum-like struct specifying the level of tracing to perform.

Fields​

  • ​value (Int): The integer value representing the trace level. Lower values indicate higher priority trace levels:
    • 0 (ALWAYS): Always traced
    • 1 (OP): Operation-level tracing
    • 2 (THREAD): Thread-level tracing

Implemented traits​

AnyType, Comparable, Copyable, Equatable, ImplicitlyCopyable, ImplicitlyDeletable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

ALWAYS​

comptime ALWAYS = TraceLevel(Int(0))

Always trace at this level.

OP​

comptime OP = TraceLevel(Int(1))

Operation-level tracing.

THREAD​

comptime THREAD = TraceLevel(Int(2))

Thread-level tracing.

Methods​

__init__​

def __init__(value: Int) -> Self

Initializes a TraceLevel with the given integer value.

Args:

  • ​value (Int): The integer value for the trace level.

__lt__​

def __lt__(self, rhs: Self) -> Bool

Performs less than comparison.

Args:

  • ​rhs (Self): The value to compare.

Returns:

Bool: True if this value is less than to rhs.

__eq__​

def __eq__(self, rhs: Self) -> Bool

Compares for equality.

Args:

  • ​rhs (Self): The value to compare.

Returns:

Bool: True if they are equal.

__int__​

def __int__(self) -> Int

Converts the trace level to an integer.

Returns:

Int: The integer value of the trace level.