Kirk Dev
中文

KirkLogging

Open Source

Structured local diagnostic logging Swift Package for macOS 14+.

Swift Package
Sanitized Fields Auto Rotation JSON Export Swift 6 Swift Package CocoaLumberjack macOS 14+ MIT

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

01

Channel & Role Isolation

Isolates logs under ~/Library/Logs/<app>/<channel>/<role>/ while correlating host and plugin events via random operationIDs.

02

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.

03

Filtered JSON Export

Provides export(to:matching:including:) and clear() APIs to filter logs by time range, module, and severity level.

04

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

KirkLogging
DiagnosticLog Swift API Screenshots coming soon
DiagnosticLog Swift API

Type-safe local diagnostics API supporting host and plugin operation tracing.

Installation & Usage

  1. 1 Requires macOS 14+ and Swift 6.0 toolchain.
  2. 2 Add https://github.com/kirktools/pkg-logging.git to your Package.swift dependencies pinned to a SemVer tag.
  3. 3 Import KirkLogging, initialize DiagnosticLog, and call record(_:module:event:).
  4. 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.

Read Privacy Policy