Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: better initialization of log verbosity level #1098
Comments
added a commit
to slintes/kubevirt
that referenced
this issue
Jun 6, 2018
added a commit
to slintes/kubevirt
that referenced
this issue
Jun 6, 2018
fabiand
assigned
slintes
Jun 7, 2018
fabiand
added this to the MVP 0.1.2 milestone
Jun 7, 2018
fabiand
added
kind/enhancement
topic/infrastructure
labels
Jun 7, 2018
rmohr
closed this
in
#1109
Jun 11, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
slintes commentedMay 31, 2018
Neither that important nor urgent, but this catched my eyes when looking into our logging implementation:
Currently we initialize both
verbosityLevelandcurrentVerbosityLevellevel to the same value, either what's given with the verbosity command line flag, or0[1].Also, info level logs are actually logged when
currentVerbosityLevel <= verbosityLevel[2]. That means as long as theV(currentVerbosityLevel)func isn't called, allInfo(...)logs are always logged, even when the verbosity flag is specified with--v=0... not sure if that is what we want, and what the user expects.Proposal:
2is the "recommended default log level for most systems". So if no verbosity flag is specified, setverbosityLevelto2.currentVerbosityLevelshould be initialized indepent ofverbosityLevel, always to the same value. A good value might be2or3(see [3]):2means: "Useful steady state information about the service and important log messages that may correlate to significant changes in the system."3means: "Extended information about changes. More info about system state changes."I'd propose to use
2, becauseInfo(...)logs withoutV(...)will be logged becausecurrentVerbosityLevel==verbosityLevel==2.0or1is provided, you see less logs, which is very likely expected behaviour imhoWdyt?
[1] https://github.com/kubevirt/kubevirt/blob/master/pkg/log/log.go#L97
[2] https://github.com/kubevirt/kubevirt/blob/master/pkg/log/log.go#L172
[3] https://github.com/kubernetes/community/blob/master/contributors/devel/logging.md