mirror of
https://github.com/google/alertmanager-irc-relay.git
synced 2024-11-30 06:59:59 +01:00
logging: clarify call depth value
Signed-off-by: Luca Bigliardi <shammash@google.com>
This commit is contained in:
parent
2eb5fb9aa5
commit
f73a0bfdf0
@ -23,6 +23,10 @@ import (
|
||||
goirc_logging "github.com/fluffle/goirc/logging"
|
||||
)
|
||||
|
||||
const (
|
||||
loggingCallDepth = 3
|
||||
)
|
||||
|
||||
type Logger interface {
|
||||
Debug(format string, args ...interface{})
|
||||
Info(format string, args ...interface{})
|
||||
@ -40,20 +44,20 @@ var debugFlag = flag.Bool("debug", false, "Enable debug logging.")
|
||||
|
||||
func (l stdOutLogger) Debug(f string, a ...interface{}) {
|
||||
if *debugFlag {
|
||||
l.out.Output(3, fmt.Sprintf("DEBUG "+f, a...))
|
||||
l.out.Output(loggingCallDepth, fmt.Sprintf("DEBUG "+f, a...))
|
||||
}
|
||||
}
|
||||
|
||||
func (l stdOutLogger) Info(f string, a ...interface{}) {
|
||||
l.out.Output(3, fmt.Sprintf("INFO "+f, a...))
|
||||
l.out.Output(loggingCallDepth, fmt.Sprintf("INFO "+f, a...))
|
||||
}
|
||||
|
||||
func (l stdOutLogger) Warn(f string, a ...interface{}) {
|
||||
l.out.Output(3, fmt.Sprintf("WARN "+f, a...))
|
||||
l.out.Output(loggingCallDepth, fmt.Sprintf("WARN "+f, a...))
|
||||
}
|
||||
|
||||
func (l stdOutLogger) Error(f string, a ...interface{}) {
|
||||
l.out.Output(3, fmt.Sprintf("ERROR "+f, a...))
|
||||
l.out.Output(loggingCallDepth, fmt.Sprintf("ERROR "+f, a...))
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
Loading…
Reference in New Issue
Block a user