I added some verbose logging to the fswatcher package in my PR and now got annoyed by all these logs on my homeserver. However I wasn’t able to get rid of verbose logging regardless of whether -verbose is used and STTRACE set or not. A quick grep search revealed that Verboseln and Verbosef are only used within verboseService to log information about events. Is it not intended to log with verbose level directly?
The setup of logging confuses me in general. E.g. in the logger.go code like
func (l *logger) Debugln(vals ...interface{}) {
l.debugln(3, vals)
}
func (l *logger) debugln(level int, vals ...interface{}) {
[...]
l.logger.Output(level, "DEBUG: "+s)
}
and
func (l *logger) Verboseln(vals ...interface{}) {
[...]
l.logger.Output(2, "VERBOSE: "+s)
it looks like the first argument to l.looger.Output
is supposed to limit what is printed, but according to the docs this is a “calldepth” which I don’t really understand what it is supposed to do, but in general there doesn’t seem to be any concept of levels in Go’s log package.
Any insights, e.g. past discussions on this matter?