Mojo struct
TraceLevel
@register_passable(trivial)
struct TraceLevel
An enum-like struct specifying the level of tracing to perform.
Aliases
ALWAYS = TraceLevel(0)
:OP = TraceLevel(1)
:THREAD = TraceLevel(2)
:
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
,
Copyable
,
EqualityComparable
,
ExplicitlyCopyable
,
Movable
,
UnknownDestructibility
Methods
__init__
@implicit
__init__(value: Int) -> Self
Initializes a TraceLevel with the given integer value.
Args:
- value (
Int
): The integer value for the trace level.
__le__
__le__(self, rhs: Self) -> Bool
Performs less than or equal to comparison.
Args:
- rhs (
Self
): The value to compare.
Returns:
True if this value is less than or equal to rhs
.
__eq__
__eq__(self, rhs: Self) -> Bool
Compares for equality.
Args:
- rhs (
Self
): The value to compare.
Returns:
True if they are equal.
__ne__
__ne__(self, rhs: Self) -> Bool
Compares for inequality.
Args:
- rhs (
Self
): The value to compare.
Returns:
True if they are not equal.
__is__
__is__(self, rhs: Self) -> Bool
Compares for equality.
Args:
- rhs (
Self
): The value to compare.
Returns:
True if they are equal.
__isnot__
__isnot__(self, rhs: Self) -> Bool
Compares for inequality.
Args:
- rhs (
Self
): The value to compare.
Returns:
True if they are not equal.
__int__
__int__(self) -> Int
Converts the trace level to an integer.
Returns:
The integer value of the trace level.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!