enum Godot::LogLevel

Overview

LogLevel: Unified typed enum containing core severity levels and user-defined log categories.

Defined in:

libgodot/logging/filter.cr

Enum Members

Off = 0_u8
Error = 1_u8
Warn = 2_u8
Info = 3_u8
Debug = 4_u8
Trace = 5_u8
Internal = 6_u8

Class Method Summary

Instance Method Summary

Instance methods inherited from struct Enum

!=(other : Int) : Bool !=, ==(other : Int) : Bool ==

Class Method Detail

def self.all_name_tags : Array(String) #

Returns all registered clean uppercase name tags


def self.all_tags : Array(String) #

Returns all registered bracketed tag strings


def self.from_line(line : String, default : LogLevel | Nil = nil) : LogLevel | Nil #

Scans a raw log line string and extracts the matching enum category if present. User-defined custom tags are evaluated first so specific categories (like {spoiler}) take precedence over generic severity tags (like [INFO]).


def self.parse?(str : String) : LogLevel | Nil #

Case-insensitive parser supporting names, tags, numbers, and aliases


Instance Method Detail

def <(other : LogLevel) : Bool #
Description copied from module Comparable(Enum)

Compares this object to other based on the receiver’s <=> method, returning true if it returns a negative number.


def <=(other : LogLevel) : Bool #
Description copied from module Comparable(Enum)

Compares this object to other based on the receiver’s <=> method, returning true if it returns a value equal or less then 0.


def <=>(other : LogLevel) : Int32 #
Description copied from module Comparable(Enum)

The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greater than other, or nil if the two objects are not comparable.

Subclasses define this method to provide class-specific ordering.

The comparison operator is usually used to sort values:

# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]

# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]

def >(other : LogLevel) : Bool #
Description copied from module Comparable(Enum)

Compares this object to other based on the receiver’s <=> method, returning true if it returns a value greater then 0.


def >=(other : LogLevel) : Bool #
Description copied from module Comparable(Enum)

Compares this object to other based on the receiver’s <=> method, returning true if it returns a value equal or greater than 0.


def ansi_color : String #

Returns the ANSI color escape sequence for terminal output


def color_bbcode : String #

Returns the BBCode color string for rich UI display (e.g. "#ff5555")


def debug? #

Returns true if this enum value equals Debug


def error? #

Returns true if this enum value equals Error


def info? #

Returns true if this enum value equals Info


def internal? #

Returns true if this enum value equals Internal


def name_tag : String #

Returns the clean uppercase identifier tag (e.g. "ERROR", "SPOILER")


def off? #

Returns true if this enum value equals Off


def severity : Int32 #

Returns the numeric severity level (1: Error, 2: Warn, 3: Info, 4: Debug, 5: Trace, etc.)


def tag : String #

Returns the bracketed log tag (e.g. "[ERROR]", "{spoiler}")


def trace? #

Returns true if this enum value equals Trace


def warn? #

Returns true if this enum value equals Warn