class Godot::DiagnosticLogger

Overview

=========================================================================== Central Thread-Safe Diagnostic Logging Dispatcher with User-Defined Filters

Manages log channels, custom status filtering, multi-sink routing, and public/safe sanitization.

Defined in:

libgodot/logging/logger.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.instance : DiagnosticLogger #

def self.new #

Class Method Detail

def self.channel(name : String) : LogChannel #

Access or create a named log channel


def self.channel_names : Array(String) #

def self.configure_channel(name : String, status : String = "active", min_level : LogLevel | Nil = nil, &block : LogChannel -> ) : LogChannel #

Configures a channel with custom status, minimum level, and user-defined filter procs


def self.dispatch(level : LogLevel, channel : String, message : String, file : String = "", line : Int32 = 0, function : String = "", tags : Array(String) = [] of String, status : String = "") : Void #

def self.filter_names : Array(String) #

def self.named_filter(name : String) : LogFilterProc | Nil #

def self.register_filter(name : String, &block : LogFilterProc) : Void #

Register a named filter globally (e.g. "public", "safe", "security", "telemetry")


def self.register_filter(name : String, filter : LogFilterProc) : Void #

Instance Method Detail

def add_sink(sink : LogSink) : Void #

def close : Void #

def console_sink : GodotConsoleSink #

def create_channel_sink(channel_name : String, path : String | Path = "log/#{channel_name}.log", min_level : LogLevel = LogLevel::Trace, &block : FileLogSink -> ) : FileLogSink #

Creates a dedicated file sink for a specific channel


def create_public_sink(path : String | Path = "log/public.log", min_level : LogLevel = LogLevel::Trace) : FileLogSink #

Creates and registers a public log sink that only captures errors and public-tagged records, preventing leakage of secret game information.


def dispatch(level : LogLevel, channel : String, message : String, file : String = "", line : Int32 = 0, function : String = "", tags : Array(String) = [] of String, status : String = "") : Void #

Dispatches a structured log message across registered channels and sinks


def file_sink : FileLogSink | Nil #

def flush : Void #

def min_level : LogLevel #

def min_level=(min_level : LogLevel) #

def remove_sink(sink : LogSink) : Void #

def ring_buffer : MemoryRingBufferSink #

def set_file_destination(path : String | Path) : Void #

def sinks : Array(LogSink) #