Skip to content

Swash 1.2.0

Latest

Choose a tag to compare

@johnrnyquist johnrnyquist released this 14 Jun 18:13

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 a Level (none/error/warning/info/debug) and a swappable output handler.
  • Engine notices that were previously unconditional print() calls now route through SwashLog.
  • Sensible defaults: .warning under DEBUG, .none in release — so a linked app stays silent unless it opts in with SwashLog.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 — SwashLog is 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 .info notices are suppressed while .warning still prints. Consumers relying on the old console output can restore it with SwashLog.level = .debug, or redirect it via SwashLog.handler.

Stats Since 1.1.0

  • 1 commit
  • 4 files changed
  • 55 insertions, 3 deletions