Skip to content
ct

Class

ItemVaultLogger

Generated GDScript class reference for ItemVault.ItemVaultLogger.

Status
Current
Version
v1.0
Updated
2026-07-31

ItemVaultLogger — static-singleton plugin log facade. One per plugin (one static class). Any addon script routes runtime output through [method ItemVaultLogger.error], [method ItemVaultLogger.warn], or [method ItemVaultLogger.info] instead of Godot's push_error / push_warning so the game can redirect, filter, or suppress it. Games inject their own [ItemVaultLogSink] via [method set_log_sink] 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 sink once — every subsequent ItemVaultLogger.warn(...) call lands on the game's destination.
  • Keeps call sites close to plain push_warning: ItemVaultLogger.warn( "InventorySave", "schema mismatch") vs push_warning("..."). No new constructor parameters, no scene wiring. Usage: # In your game's bootstrap, keep a strong owner for the sink. var _item_vault_log_sink := MyGameLogSink.new() ItemVaultLogger.set_log_sink(_item_vault_log_sink) # Anywhere in the addon: ItemVaultLogger.error("InventorySave", "version mismatch") ItemVaultLogger.warn("MoveOnSpawn", "missing settings, skipping") Addon runtime code should call this facade, not Godot logging directly. The default sink preserves editor/stderr output when no game sink is installed.

Source: addons/item_vault/logging/item_vault_logger.gd

Syntax

class ItemVaultLogger extends RefCounted

Members

NameKindSummary
set_log_sinkMethod
clear_log_sinkMethod
get_log_sinkMethod
errorMethod
warnMethod
infoMethod
errorMethod
warnMethod
infoMethod