Full-feature v3 showcase example app + library fixes - #9
Merged
Conversation
Merge develop into main for v3.0.0 release. Preserves the full 29-commit history (no squash) so feature/fix/docs provenance stays visible in `git log main`. After this merge the 3.0.0 tag should be re-anchored on main HEAD and the GitHub Release target switched to main.
- FlightRecorder.defaultFileURL: made public so it can be the default argument of the public recoverLastSession(from:) API (was previously internal, blocking adopters from calling the API without supplying a URL). - FlightRecorder.start(): always register *this* recorder's private MemoryLogEngine. The previous check skipped registration whenever any MemoryLogEngine was already registered, silently breaking recording for adopters who wire their own memory engine first. - MetricKitCrashReporter: MXHangDiagnostic.hangDuration is a Measurement<UnitDuration> on the iOS 17+ SDK, not NSNumber-coercible. Convert via .converted(to: .milliseconds).value. - LogConsoleViewModel.entries: relax setter to internal(set) so @testable test cases can seed entries directly. - FlightRecorderTests: reset the global registry + minimum level in setUp so previous-suite leftovers don't mask captured entries. - Package.swift platforms: bump to iOS 16 / macOS 13 / tvOS 16 / watchOS 9 — the UI module already uses NavigationStack + LabeledContent (iOS 16+) unguarded, so the iOS 15 declaration was incorrect.
Rewrites the SwiftMoLoggerExample iOS app from a 3-tab minimal demo into an end-to-end showcase that links and exercises every product in the package, so adopters can hand the app to a teammate and see the entire v3 surface in motion. What changed: - xcodeproj: wire SwiftMoLoggerUI / Network / Diagnostics / Remote / Sugar as package-product dependencies (previously only SwiftMoLogger was linked even though ContentView already imported UI). Deployment target bumped to iOS 17. - SwiftMoLoggerExampleApp: configureLogging() now boots Memory + System, ErrorGroupingEngine, RedactingLogEngine, a file engine wrapped in SamplingLogEngine + RateLimitingLogEngine, NetworkLogger on URLSession.shared, AppVitalsMonitor, and a FlightRecorder. One static function = the whole integration surface. - ContentView: 6 tabs — Demo, Console (bundled), Hub (bundled), Network, Diagnostics, About. Demo tab exercises every log level, error(Error), breadcrumbs, LogSignpost.measure + nested spans, the #log / #measure / @autolog macros from SwiftMoLoggerSugar, withContext, withTrace (W3C traceparent), regex redaction, and error grouping. - Network tab: real httpbin.org requests (200 / 404 / 500 / inside withTrace) flowing through NetworkLoggingProtocol so the Hub's waterfall and breadcrumbs populate live. - Diagnostics tab: live AppVitalsMonitor sample, FlightRecorder note, one-tap BugReporter bundle generation with ShareLink, Bonjour LiveSink toggle, and snippets for Sentry / Datadog / Loki / MetricKit. - About tab: full feature matrix — useful talking points when recommending the library to other apps. - README: rewritten to match the 6-tab structure and document the full set of products and the boot wiring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rewrites
ExampleApp/SwiftMoLoggerExamplefrom a 3-tab minimal demo into an end-to-end showcase that links and exercises every product in the package — so the app can be handed to a teammate (or to other apps' maintainers) and demonstrate the full v3 surface in one binary.Also fixes a handful of library bugs surfaced while wiring the showcase.
Library fixes (commit 1)
FlightRecorder.defaultFileURL— was internal but used as the default arg of the publicrecoverLastSession(from:); promoted to public so adopters can actually call the API without a URL.FlightRecorder.start()— always registers this recorder's privateMemoryLogEngine. The previous check skipped registration whenever anyMemoryLogEngineexisted in the registry, silently breaking recording for adopters who wire their own first.MetricKitCrashReporter—MXHangDiagnostic.hangDurationis aMeasurement<UnitDuration>on iOS 17+ SDK, not NSNumber-coercible. Converted via.converted(to: .milliseconds).value.LogConsoleViewModel.entries— relaxed tointernal(set)so@testabletests can seed entries directly (matched the existing tests).FlightRecorderTests— added asetUpthat resets the global registry + minimum level so previous-suite leftovers don't mask captured entries.Package.swiftplatforms — bumped to iOS 16 / macOS 13 / tvOS 16 / watchOS 9. The UI module already usesNavigationStack+LabeledContentunguarded, so the iOS 15 declaration was incorrect.All 70 tests pass after the changes.
Showcase app (commit 2)
SwiftMoLoggerUI/Network/Diagnostics/Remote/Sugar(previously onlySwiftMoLoggerwas wired even thoughContentViewalready imported UI). Deployment target → iOS 17.SwiftMoLoggerExampleApp.configureLogging()boots the full stack in one function: Memory + System engines,ErrorGroupingEngine,RedactingLogEngine, a file engine wrapped inSamplingLogEngine+RateLimitingLogEngine,NetworkLogger.installOnSharedSession(),AppVitalsMonitor, and aFlightRecorder.error(Error), breadcrumbs,LogSignpost.measure+ nested spans, the#log/#measure/@AutoLogmacros,withContext,withTrace(W3C traceparent), regex redaction, and error grouping.LogConsoleView.DiagnosticsHubView(timeline, network waterfall, flame graph, vitals charts, breadcrumb trail).httpbin.orgrequests (200 / 404 / 500 / insidewithTrace) flowing throughNetworkLoggingProtocol, populating the Hub's waterfall and breadcrumbs live.AppVitalsMonitorsample,FlightRecorderstatus, one-tapBugReporterbundle withShareLink, BonjourLiveSinktoggle, and snippets for Sentry / Datadog / Loki / MetricKit.Test plan
swift test— 70/70 passxcodebuild -scheme SwiftMoLoggerExample -destination 'generic/platform=iOS Simulator' buildsucceeds⌘Ron a simulator, click through each tab — verify Hub populates after a few minutes of activity[REDACTED]in the Consoleswiftmologger-inspectoron macOS sees the Bonjour service