Files
swift-hpa/Sources/hpa/Internal/LoggingExtensions.swift
Michael Housh faa28749bc
All checks were successful
CI / Run Tests (push) Successful in 2m43s
feat: Merges dev
2024-12-17 15:55:36 -05:00

23 lines
440 B
Swift

import Logging
extension Logger.Level {
/// Set the log level based on the user's options supplied.
init(globals: BasicGlobalOptions, quietOnlyPlaybook: Bool) {
if !quietOnlyPlaybook && !globals.quiet {
switch globals.verbose {
case 0:
self = .info
case 1:
self = .debug
case 2...:
self = .trace
default:
self = .info
}
return
}
self = .info
}
}