Skip to content

Create custom loggers using a subsystem identifier and a log level.

License

Notifications You must be signed in to change notification settings

BinaryBirds/swift-log-env

Repository files navigation

SwiftLogEnv

Create custom loggers using a subsystem identifier and a log level.

Install

Add the repository as a dependency:

.package(url: "https://github.com/binarybirds/swift-log-env", from: "1.0.0"),

Add SwiftLogEnv to the target dependencies:

.product(name: "SwiftLogEnv", package: "swift-log-env"),

Update the packages and you are ready.

Usage example

Basic example

import SwiftLogEnv

let libLogger = Logger.subsystem("my-lib", .notice)
let appLogger = Logger.subsystem("my-app", .notice)

// LOG_LEVEL=info MY_LIB_LOG_LEVEL=trace swift run MyApp