-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathdiagnostics.go
More file actions
24 lines (19 loc) · 784 Bytes
/
diagnostics.go
File metadata and controls
24 lines (19 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package options
import (
"github.com/spf13/pflag"
"github.com/openshift/origin/pkg/diagnostics/log"
)
// LoggerOptionFlags enable the user to specify how they want output.
type LoggerOptionFlags struct {
Level FlagInfo
}
// RecommendedLoggerOptionFlags provides default overrideable Logger flag specifications to be bound to options.
func RecommendedLoggerOptionFlags() LoggerOptionFlags {
return LoggerOptionFlags{
Level: FlagInfo{FlagLevelName, "l", "1", "Level of diagnostic output: 4: Error, 3: Warn, 2: Notice, 1: Info, 0: Debug"},
}
}
// BindLoggerOptionFlags binds flags to LoggerOptionFlags.
func BindLoggerOptionFlags(cmdFlags *pflag.FlagSet, loggerOptions *log.LoggerOptions, flags LoggerOptionFlags) {
flags.Level.BindIntFlag(cmdFlags, &loggerOptions.Level)
}