GPLogger
AUTO-GENERATED FILE — DO NOT EDIT MANUALLY
Source: core/logging/gb_logger.gd
Version: 5.1
class_name: GPLogger
extends: RefCounted
Summary
Centralized logging facility for the Grid Building plugin.
USAGE: Consider dropping log level on the GBDebugSettings if you are getting too many messages
Responsibilities:
- Provide contextual logging (verbose, error, warning) integrated with plugin debug settings.
- Support dependency-injected configuration and throttled verbose output.
Signals
(none)
Exports
(none)
Methods
set_log_sink()_get_caller_id()- Helper to get caller identifier from stack
_is_throttled()- Helper to check if logging should be throttled
_should_log_once()- Helper to check if logging should happen only once
_get_context_from_stack()- Helper to get context string from stack
_is_likely_test_environment()- Helper to detect if we’re likely in a test environment
log_at()- Central dispatcher that accepts a debug
levelandp_messagewhich may be aStringor aCallableprovider.
- Central dispatcher that accepts a debug
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.
_init()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).
_materialize_message()- Internal helper to materialize a message that may be a String or a Callable.
log()- Alias
logto the central dispatcher for convenience
- Alias
log_debug_lazy()_emit_log()- Emits the log message to the appropriate output (console or custom sink).
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.[br][br] [code]p_issue[/code]: [i]String[/i] - Error message to log
log_warnings()- Logs multiple warning messages for the specified sender object.[br][br] [code]p_issues[/code]: [i]Array[String][/i] - Array of warning messages to log
log_issues()- Logs multiple issues as warnings (alias for log_warnings).[br][br] [code]p_issues[/code]: [i]Array[String][/i] - Array of issue messages to log as warnings
log_verbose()- Logs a verbose message for debugging purposes.[br][br] [code]p_message[/code]: [i]String[/i] - 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 GPLogger is currently using
set_log_level()- Change the level of the GBDebugSettings to change how much information is logged