Skip to content

SwiftMoLogger 3.0.0

Choose a tag to compare

@MoElnaggar14 MoElnaggar14 released this 11 May 20:28
· 73 commits to main since this release

SwiftMoLogger 3.0.0 — complete rewrite around structured LogEntry, Swift Concurrency, and a multi-product architecture.

Re-issued from a fresh 3.0.0 commit on main that bundles the v3.0.0 feature set with a few library fixes surfaced while wiring the end-to-end example app.

✨ Highlights

  • Structured LogEntry everywhere — level, tag, metadata, source location, timestamp.
  • Multi-engine fan-out: Memory + System + File + Remote + custom.
  • SamplingLogEngine + RateLimitingLogEngine decorators for field-device sanity.
  • RedactingLogEngine — regex PII scrubber on emails, tokens, card numbers.
  • ErrorGroupingEngine — identical-shape errors collapse into a fingerprinted group.
  • Sentry-compatible breadcrumbs ring buffer.
  • LogSignpost.measure spans + #log / #measure / @AutoLog macros via SwiftMoLoggerSugar.
  • W3C distributed tracing — TraceContext + traceparent injection through SwiftMoLoggerNetwork.
  • DiagnosticsHubView — live SwiftUI hub: timeline, network waterfall, signpost flame graph, vitals charts, breadcrumbs.
  • FlightRecorder — rolling 2-minute black box for post-crash forensics.
  • AppVitalsMonitor — periodic memory / CPU / FPS / thermal / battery.
  • BugReporter — one-call bundle of logs + breadcrumbs + vitals + device info, ready for ShareLink.
  • LiveSink + swiftmologger-inspector CLI — Bonjour log tail for DEBUG builds.
  • MetricKitCrashReporter — mirror MetricKit crash + hang payloads into the pipeline.
  • Remote shippers: Sentry envelopes, Datadog logs API, Grafana Loki push.
  • Testing helpers: XCTAssertLogged + RecordingLogEngine.
  • Ships PrivacyInfo.xcprivacy.

🔧 Library fixes folded into this 3.0.0 cut

  • FlightRecorder.defaultFileURL is now public (was internal but referenced as a public default arg — caused a compile error on adopters).
  • FlightRecorder.start() always registers its own memory engine instead of silently skipping when any MemoryLogEngine was already in the registry.
  • MetricKitCrashReporter updated for iOS 17+ SDK where MXHangDiagnostic.hangDuration is now a Measurement<UnitDuration>.
  • LogConsoleViewModel.entries relaxed to internal(set) so @testable consumers can seed entries.
  • FlightRecorderTests reset global state in setUp.
  • Package.swift platforms now declare iOS 16 / macOS 13 / tvOS 16 / watchOS 9 (the UI module already used iOS-16-only APIs unguarded).

📦 Products

  • SwiftMoLogger — core API + engines
  • SwiftMoLoggerUI — Console + Diagnostics Hub
  • SwiftMoLoggerNetwork — auto URLSession capture
  • SwiftMoLoggerDiagnostics — vitals, bug report, LiveSink, WebSocket tail
  • SwiftMoLoggerSugar — #log / #measure / @AutoLog macros
  • SwiftMoLoggerRemote — Sentry / Datadog / Loki shippers
  • SwiftMoLoggerTesting — XCTest helpers
  • swiftmologger-inspector — macOS CLI Bonjour log tail

📱 End-to-end showcase

ExampleApp/SwiftMoLoggerExample now exercises every product in 6 tabs (Demo / Console / Hub / Network / Diagnostics / About). Open the project, ⌘R, and you'll see the entire v3 surface in motion.

📥 Install

.package(url: "https://github.com/MoElnaggar14/SwiftMoLogger.git", from: "3.0.0")

⚠️ Note for adopters who already pinned 3.0.0: the tag was rewritten to point at this fresh commit. Run swift package resolve (or File → Packages → Reset Package Caches in Xcode) to pick up the new hash.