Skip to content

Commit

Permalink
Get loglevel from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed May 4, 2024
1 parent 5bee64a commit 78f96b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/App/Application+build.swift
Expand Up @@ -14,7 +14,10 @@ public protocol AppArguments {
public func buildApplication(_ arguments: some AppArguments) -> some ApplicationProtocol {
let logger = {
var logger = Logger(label: "{{HB_PACKAGE_NAME}}")
logger.logLevel = arguments.logLevel ?? .info
logger.logLevel =
arguments.logLevel ??
Environment.shared.get("LOG_LEVEL").map { Logger.Level(rawValue: $0) ?? .info } ??
.info
return logger
}()
let router = Router()
Expand Down

0 comments on commit 78f96b4

Please sign in to comment.