Skip to content

Commit e06fc39

Browse files
committed
Add warning option for logger
1 parent 1780e59 commit e06fc39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mqmetric/log.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
type Logger struct {
2727
Debug func(string, ...interface{})
2828
Info func(string, ...interface{})
29+
Warn func(string, ...interface{})
2930
Error func(string, ...interface{})
3031
}
3132

@@ -45,6 +46,11 @@ func logInfo(format string, v ...interface{}) {
4546
logger.Info(format, v...)
4647
}
4748
}
49+
func logWarn(format string, v ...interface{}) {
50+
if logger != nil && logger.Warn != nil {
51+
logger.Warn(format, v...)
52+
}
53+
}
4854

4955
// Errors should be reported always. Also use this for what you might
5056
// think of as warnings.

0 commit comments

Comments
 (0)