Chris' Tutorials
Docs/Grid Placement

Class

PlacementLogger

Generated GDScript class reference for GridPlacement.PlacementLogger.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

Centralized logging facility for the Grid Building plugin. [b]Static singleton API (preferred):[/b] [codeblock] # Once, during plugin initialization: PlacementLogger.set_instance(logger) # Anywhere in the plugin — zero boilerplate, zero null checks: PlacementLogger.debug("msg") PlacementLogger.trace("msg") PlacementLogger.warn("msg") PlacementLogger.error("msg") [/codeblock] [b]Overriding the logger at game time:[/b] Game developers can replace the logger at any point by calling [method set_instance] with their own [PlacementLogger] instance. The static helpers automatically route through the current instance. [codeblock] # Replace with your own logger (e.g. with custom log_sink, different level): var my_logger := PlacementLogger.new(my_debug_settings) PlacementLogger.set_instance(my_logger) # Or disable all plugin logging: PlacementLogger.clear_instance() [/codeblock] [b]Test isolation:[/b] [codeblock] func before_test() -> void: PlacementLogger.set_instance(mock_logger) func after_test() -> void: PlacementLogger.clear_instance() [/codeblock] [b]Instance API (still available for backward compat):[/b] [code]logger.log_debug("msg")[/code] USAGE: Consider dropping log level on the PlacementDebugSettings 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.

Source: addons/grid_placement/logging/placement_logger.gd

Syntax

class PlacementLogger extends PlacementInjectable

Members

NameKindSummary
set_instanceMethod
clear_instanceMethod
debugMethod
traceMethod
infoMethod
warnMethod
errorMethod
verboseMethod
VERBOSE_MIN_INTERVAL_MSField
LogLevelFieldShorthand alias for levels to reduce verbosity at callsites
create_with_injectionMethod
debug_settingsProperty
loggerProperty
issuesProperty
set_log_sinkMethod
stackProperty
callerProperty
sourceProperty
functionProperty
compositeProperty
now_msProperty
last_msProperty
compositeProperty
stackProperty
callerProperty
sourceProperty
functionProperty
lineProperty
file_nameProperty
callerProperty
sourceProperty
functionProperty
lineProperty
file_nameProperty
log_atMethod
contextProperty
msgProperty
get_runtime_issuesMethod
issuesProperty
resolve_placement_dependenciesMethod
is_level_enabledMethod
is_debug_enabledMethod
is_verbose_enabledMethod
is_trace_enabledMethod
cProperty
resultProperty
logMethod
log_debug_lazyMethod
msg_formattedProperty
log_warningMethod
log_infoMethod
log_errorMethod
log_warningsMethod
log_issuesMethod
log_verboseMethod
log_traceMethod
log_debugMethod
log_verbose_throttledMethod
caller_idProperty
keyProperty
log_debug_throttledMethod
caller_idProperty
keyProperty
log_trace_throttledMethod
caller_idProperty
keyProperty
log_verbose_onceMethod
caller_idProperty
keyProperty
log_debug_onceMethod
caller_idProperty
keyProperty
log_trace_onceMethod
caller_idProperty
keyProperty
log_warning_onceMethod
caller_idProperty
keyProperty
log_error_onceMethod
caller_idProperty

Source

addons/grid_placement/logging/placement_logger.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs