Skip to content
ct

Class

ItemVaultLogger

Generated GDScript class reference for ItemVault.ItemVaultLogger.

Status
Draft
Version
v1.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.

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
resolvedProperty
errorMethod
warnMethod
infoMethod
errorMethod
warnMethod
infoMethod