Skip to main content

Mojo struct

TraceLevel

@register_passable(trivial) 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, Identifiable, ImplicitlyCopyable, Movable, UnknownDestructibility

Aliases

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

ALWAYS

comptime ALWAYS = TraceLevel(0)

OP

comptime OP = TraceLevel(1)

THREAD

comptime THREAD = TraceLevel(2)

Methods

__init__

__init__(value: Int) -> Self

Initializes a TraceLevel with the given integer value.

Args:

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

__lt__

__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__

__eq__(self, rhs: Self) -> Bool

Compares for equality.

Args:

  • rhs (Self): The value to compare.

Returns:

Bool: True if they are equal.

__is__

__is__(self, rhs: Self) -> Bool

Compares for equality.

Args:

  • rhs (Self): The value to compare.

Returns:

Bool: True if they are equal.

__int__

__int__(self) -> Int

Converts the trace level to an integer.

Returns:

Int: The integer value of the trace level.

Was this page helpful?