GBLogger
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Centralized logging facility for the Grid Building plugin.
Source File: addons/grid_building/logging/gb_logger.gd
Extends: GBInjectable
Private Properties
- Property:
_debug := GBDebugSettings.new()(private) - Property:
_verbose_once: Dictionary[String, bool] = {}(private) - Property:
_debug_once: Dictionary[String, bool] = {}(private) - Property:
_trace_once: Dictionary[String, bool] = {}(private) - Property:
_warning_once: Dictionary[String, bool] = {}(private) - Property:
_error_once: Dictionary[String, bool] = {}(private) - Property:
_info_once: Dictionary[String, bool] = {}(private) - Property:
_verbose_last_ts: Dictionary[String, int] = {}(private) - Property:
_log_sink: Callable(private)
Constants
- Constant:
VERBOSE_MIN_INTERVAL_MS := 250 - Constant:
LogLevel = GBDebugSettings.LogLevel- Shorthand alias for levels to reduce verbosity at callsites
Public Methods
create_with_injection
Flags: static
Creates a GBLogger with dependency injection from container.
set_log_sink
log_at
Central dispatcher that accepts a debug level and p_message which may be a String or a Callable provider.
get_runtime_issues
Validates that debug settings have been injected. Returns list of validation issues (empty if valid).
resolve_gb_dependencies
Receives injected dependencies from the composition container. Assigns debug settings if available.
is_level_enabled
Returns true if the given debug level is enabled.
is_debug_enabled
Returns true if verbose/debug logging is currently enabled.
is_verbose_enabled
Returns true if verbose logging is currently enabled.
is_trace_enabled
Returns true if trace logging is currently enabled (the most detailed level).
log
Alias log to the central dispatcher for convenience
log_debug_lazy
log_warning
log_info
Logs an informational message (between WARNING and DEBUG levels) Only prints when debug level >= INFO
log_error
Logs an error message for the specified sender object.
p_issue: String - Error message to log
log_warnings
Logs multiple warning messages for the specified sender object.
p_issues: Array[String] - Array of warning messages to log
log_issues
Logs multiple issues as warnings (alias for log_warnings).
p_issues: Array[String] - Array of issue messages to log as warnings
log_verbose
Logs a verbose message for debugging purposes.
p_message: String - Verbose message to log
log_trace
Trace-level log for extremely detailed diagnostics (above VERBOSE)
log_debug
Debug-level log helper (alias of verbose at VERBOSE level)
log_verbose_throttled
Throttled verbose logging: prints at most every N ms per object instance.
log_debug_throttled
Throttled debug helper (alias of verbose throttled)
log_trace_throttled
Throttled trace helper
log_verbose_once
Logs a verbose message only once per object instance.
log_debug_once
Log a debug message only once per object instance.
log_trace_once
Log a trace message only once per object instance.
log_warning_once
Log a warning message only once per object instance.
log_error_once
Logs an error message, but only once per object instance.
log_info_once
Logs an info message, but only once per object instance.
get_debug_settings
Returns the GBDebugSettings that the GBLogger is currently using
set_log_level
Change the level of the GBDebugSettings to change how much information is logged
Private Methods
_get_caller_id
Flags: private
Helper to get caller identifier from stack
_is_throttled
Flags: private
Helper to check if logging should be throttled
_should_log_once
Flags: private
Helper to check if logging should happen only once
_get_context_from_stack
Flags: private
Helper to get context string from stack
_is_likely_test_environment
Flags: private
Helper to detect if we’re likely in a test environment
_init
Flags: private
_materialize_message
Flags: private
Internal helper to materialize a message that may be a String or a Callable.
_emit_log
Flags: private
Emits the log message to the appropriate output (console or custom sink).