GBLogger
Summary
Section titled “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.
Methods
Section titled “Methods”static func create_with_injection( container: GBCompositionContainer ) -> GBLoggerCreates a GBLogger with dependency injection from container.
func set_log_sink( p_sink: Callable ) -> voidfunc _get_caller_id( ) -> StringHelper to get caller identifier from stack
func _is_throttled( caller_id: String, key: String ) -> boolHelper to check if logging should be throttled
func _should_log_once( caller_id: String, key: String, once_dict: Dictionary ) -> boolHelper to check if logging should happen only once
func _get_context_from_stack( ) -> StringHelper to get context string from stack
func _is_likely_test_environment( ) -> boolHelper to detect if we’re likely in a test environment
func log_at( level: LogLevel, p_message ) -> voidCentral dispatcher that accepts a debug
levelandp_messagewhich may be aStringor aCallableprovider.func get_runtime_issues( ) -> Array[String]Validates that debug settings have been injected. Returns list of validation issues (empty if valid).
func resolve_gb_dependencies( p_config: GBCompositionContainer ) -> boolReceives injected dependencies from the composition container. Assigns debug settings if available.
func _init( p_debug_settings: GBDebugSettings ) -> voidfunc is_level_enabled( level: LogLevel ) -> boolReturns true if the given debug level is enabled.
func is_debug_enabled( ) -> boolReturns true if verbose/debug logging is currently enabled.
func is_verbose_enabled( ) -> boolReturns true if verbose logging is currently enabled.
func is_trace_enabled( ) -> boolReturns true if trace logging is currently enabled (the most detailed level).
func _materialize_message( p_provider ) -> StringInternal helper to materialize a message that may be a String or a Callable.
func log( level: LogLevel, p_message ) -> voidAlias
logto the central dispatcher for conveniencefunc log_debug_lazy( p_provider: Callable ) -> voidfunc _emit_log( level: int, context: String, message: String ) -> voidEmits the log message to the appropriate output (console or custom sink).
func log_warning( p_issue: String ) -> voidfunc log_info( p_message: String ) -> voidLogs an informational message (between WARNING and DEBUG levels) Only prints when debug level >= INFO
func log_error( p_issue: String ) -> voidLogs an error message for the specified sender object.
p_issue: String - Error message to logfunc log_warnings( p_issues: Array[String] ) -> voidLogs multiple warning messages for the specified sender object.
p_issues: Array[String] - Array of warning messages to logfunc log_issues( p_issues: Array[String] ) -> voidLogs multiple issues as warnings (alias for log_warnings).
p_issues: Array[String] - Array of issue messages to log as warningsfunc log_verbose( p_message: String ) -> voidLogs a verbose message for debugging purposes.
p_message: String - Verbose message to logfunc log_trace( p_message: String ) -> voidTrace-level log for extremely detailed diagnostics (above VERBOSE)
func log_debug( p_message: String ) -> voidDebug-level log helper (alias of verbose at VERBOSE level)
func log_verbose_throttled( p_object: Object, p_message: String ) -> voidThrottled verbose logging: prints at most every N ms per object instance.
func log_debug_throttled( p_object: Object, p_message: String ) -> voidThrottled debug helper (alias of verbose throttled)
func log_trace_throttled( p_object: Object, p_message: String ) -> voidThrottled trace helper
func log_verbose_once( p_object: Object, p_message: String ) -> voidLogs a verbose message only once per object instance.
func log_debug_once( p_object: Object, p_message: String ) -> voidLog a debug message only once per object instance.
func log_trace_once( p_object: Object, p_message: String ) -> voidLog a trace message only once per object instance.
func log_warning_once( p_object: Object, p_message: String ) -> voidLog a warning message only once per object instance.
func log_error_once( p_object: Object, p_message: String ) -> voidLogs an error message, but only once per object instance.
func log_info_once( p_object: Object, p_message: String ) -> voidLogs an info message, but only once per object instance.
func get_debug_settings( ) -> GBDebugSettingsReturns the GBDebugSettings that the GBLogger is currently using
func set_log_level( p_level: LogLevel ) -> voidChange the level of the GBDebugSettings to change how much information is logged
Source
Section titled “Source”addons/grid_building/logging/gb_logger.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.