Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 611 Bytes

README.md

File metadata and controls

32 lines (20 loc) · 611 Bytes

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