Files
swift-hpa/Sources/hpa/Internal/LoggingExtensions.swift

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
}
}