Skip to content
ct

Class

PlacementLogger

Generated GDScript class reference for GridPlacement.PlacementLogger.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

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

Centralized logging facility for the Grid Building plugin. [b]Static singleton API (preferred):[/b] [codeblock] # Once, during plugin initialization: PlacementLogger.initialize(debug_settings) ## # Or push a scoped override for a sub-region (tests, plugins): PlacementLogger.push_scope(custom_logger) # ... do work ... PlacementLogger.pop_scope() # 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 global emitter by calling [method initialize] again at any point — that replaces the production root. For bounded overrides (a single test, a single plugin sub-region) prefer [method push_scope] / [method pop_scope] so the override auto-cleans when the scoped region exits. [b]Test isolation:[/b] Tests call [method push_scope] in before_test and [method pop_scope] in after_test to substitute the production emitter with a muted or spy logger for the duration of one test. Sequential GdUnit4 execution keeps the stack consistent across tests. [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 RefCounted

Members

NameKindSummary
push_scopeMethod
pop_scopeMethod
set_instanceMethod
clear_instanceMethod
refProperty
objProperty
initializeMethod
settingsProperty
loggerProperty
dsProperty
VERBOSE_MIN_INTERVAL_MSField
LogLevelFieldShorthand alias for levels to reduce verbosity at callsites
create_with_injectionMethod
loggerProperty
issuesProperty
debugMethod
loggerProperty
traceMethod
loggerProperty
infoMethod
loggerProperty
warnMethod
loggerProperty
errorMethod
loggerProperty
verboseMethod
loggerProperty
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