CalendarTimeLogger — static-singleton plugin log facade. One per plugin (one per static class). Any addon script routes runtime output through CalendarTimeLogger.error("Source", msg) instead of Godot's push_error so the game can redirect, filter, or suppress it. Games inject their own LogSink via CalendarTimeLogger.set_logger(...) at boot. Default behavior (no injection): routes through Godot's push_error / push_warning / print so existing editor + stderr output is preserved. Pattern: static singleton, not per-instance injection. Reasons:
- Plugins shouldn't need to wire a logger into every script (refcounts, save/load, validators, services, etc.).
- Games boot the plugin once and set the logger once — every subsequent
CalendarTimeLogger.error(...)call lands on the game's destination. - Keeps the call site identical to
push_error:CalendarTimeLogger.error( "AgeService", "no clock")vspush_error("..."). No new constructor parameters, no scene wiring. Usage: # In your game's bootstrap: CalendarTimeLogger.set_logger(MyGameLogger.new()) # Anywhere in the addon: CalendarTimeLogger.error("GameClock", "calendar is null") CalendarTimeLogger.warn("AgeService", "REAL_TIME_ELAPSED not supported on Resource") Addon runtime code should call this facade, not Godot logging directly. The default logger preserves editor/stderr output when no game logger is installed.
Source: addons/calendar_time/utils/calendar_time_logger.gd
Syntax
class CalendarTimeLogger extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
set_logger | Method | |
get_logger | Method | |
error | Method | |
warn | Method | |
info | Method | |
error | Method | |
warn | Method | |
info | Method |
Source
addons/calendar_time/utils/calendar_time_logger.gd
Plugin docs root:gdscript/plugins/calendar_time_dev/docs