Repository navigation
This release makes Swash's engine diagnostics configurable. The engine's informational notices are now gated behind a log-level toggle so they no longer print unconditionally — quiet by default in shipping apps, while still surfacing genuine warnings during development.
Highlights
- Added
SwashLog, a configurable diagnostic logger with aLevel(none/error/warning/info/debug) and a swappable outputhandler. - Engine notices that were previously unconditional
print()calls now route throughSwashLog. - Sensible defaults:
.warningunder DEBUG,.nonein release — so a linked app stays silent unless it opts in withSwashLog.level = .debug.
Added
- Sources/Swash/core/SwashLog.swift
Changed
Engine.removeEntities(named:)"did not contain entity" notice is now logged at.info.Entity.remove(componentClass:)"does not exist" notice is now logged at.info.SystemList.add(system:)duplicate-add notice is now logged at.warning.
Compatibility Notes
- Additive public API —
SwashLogis new; no existing symbols were changed or removed. Source-compatible with 1.1.0. - One intentional behavior change: those three notices no longer print unconditionally. In release they are silent by default; under DEBUG the two
.infonotices are suppressed while.warningstill prints. Consumers relying on the old console output can restore it withSwashLog.level = .debug, or redirect it viaSwashLog.handler.
Stats Since 1.1.0
- 1 commit
- 4 files changed
- 55 insertions, 3 deletions