BinaryBirds / swift-log-env

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:MIT License


Languages

Language:Shell 63.7%Language:Swift 33.0%Language:Makefile 3.3%