Wrapper around Apple's Swift unified logging APIs, particularly Logger.
Provides public and private logging with an app-facing AppLogLevel abstraction, so clients do not need to import os to choose a log level. The default level is .default, which maps to OSLogType.default and shows up in Console.app without requiring debug filtering.
For the complete API reference and usage guide, see the AppLogger DocC documentation.
import AppLogger
let logger = AppLogger(subsystem: "com.example.app", category: "network")
// Log public information.
logger.log("Request started")
// Log private information.
logger.log(level: .info, "Request headers: \(headers)", isPrivate: true)
// Set custom levels.
logger.log(level: .error, "Request failed: \(error.localizedDescription)").default, .error, and .fault logs are shown by default in the Console app. If you emit debug logs, enable Action / Include Info/Debug Messages to display them.
Keep in mind that private information will still be visible in the Console app as clear text if the device is attached to the debugger. Apparently this is by design.
Use Xcode's built-in support for SPM.
In your Package.swift, add AppLogger as a dependency:
dependencies: [
.package(
url: "https://github.com/thatfactory/applogger",
from: "1.0.0"
)
]Associate the dependency with your target:
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(
name: "AppLogger",
package: "applogger"
)
]
)
]Run: swift build


