Verbose to be used only for events through verboseService?

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?

Yes, Verbose is just Info with a different prefix. The only real purpose for it at the moment is to use from the verboseService. Debug is the only one that contains magic to only log when debug info is enabled. That’s a “recent” addition, originally it was always

if debug {
    l.Debugln("foo")
}

but for convenience the logger package gained understanding of whether debugging is enabled or not so the outer if can be skipped in most cases.

Use Debug and hide it behind an STTRACE tag.