KirkLogging
Open SourceStructured local diagnostic logging Swift Package for macOS 14+.
Overview
KirkLogging (kirktools/pkg-logging) is the shared local diagnostic logging Swift Package powering kirktools macOS apps. Backed by CocoaLumberjack for async file writing and rotation, it enforces strict sanitized field boundaries and JSON export filtering.
Key Features
Channel & Role Isolation
Isolates logs under ~/Library/Logs/<app>/<channel>/<role>/ while correlating host and plugin events via random operationIDs.
Automatic Rotation & Backpressure
Rotates at ~1 MiB or daily with up to 3 archives; async write queue tracks droppedEvents under heavy load without blocking the main thread.
Filtered JSON Export
Provides export(to:matching:including:) and clear() APIs to filter logs by time range, module, and severity level.
Privacy-by-Design Boundaries
Restricts events and error codes to static categories and timings, preventing screenshots, user text, credentials, or personal paths from entering logs.
Preview
Type-safe local diagnostics API supporting host and plugin operation tracing.
Installation & Usage
- 1 Requires macOS 14+ and Swift 6.0 toolchain.
- 2 Add https://github.com/kirktools/pkg-logging.git to your Package.swift dependencies pinned to a SemVer tag.
- 3 Import KirkLogging, initialize DiagnosticLog, and call record(_:module:event:).
- 4 Run swift test inside the package directory to verify rotation, filtering, and isolation.
Privacy & Permissions
Read the complete privacy policy, local storage guarantees, and permission details for KirkLogging.