Add docstrings to a logger

This commit is contained in:
9seconds
2021-04-08 14:39:01 +03:00
parent d3aa0f2de5
commit 0652f322fa
+22
View File
@@ -239,16 +239,38 @@ type TimeAttackDetector interface {
// logger1 should see no param2 and vice versa, logger2 should not see param1 // logger1 should see no param2 and vice versa, logger2 should not see param1
// If you attach a parameter to a logger, parents should not know about that. // If you attach a parameter to a logger, parents should not know about that.
type Logger interface { type Logger interface {
// Named returns a new logger with a bound name. Name chaining is
// allowed and appreciated.
Named(name string) Logger Named(name string) Logger
// BindInt binds new integer parameter to a new logger instance.
BindInt(name string, value int) Logger BindInt(name string, value int) Logger
// BindStr binds new string parameter to a new logger instance.
BindStr(name, value string) Logger BindStr(name, value string) Logger
// Printf is to support log.Logger behavior.
Printf(format string, args ...interface{}) Printf(format string, args ...interface{})
// Info puts a message about some normal situation.
Info(msg string) Info(msg string)
// InfoError puts a message about some normal situation but this
// situation is related to a given error.
InfoError(msg string, err error) InfoError(msg string, err error)
// Warning puts a message about some extraordinary situation
// worth to look at.
Warning(msg string) Warning(msg string)
// WarningError puts a message about some extraordinary situation
// worth to look at. This situation is related to a given error.
WarningError(msg string, err error) WarningError(msg string, err error)
// Debug puts a message useful for debugging only.
Debug(msg string) Debug(msg string)
// Debug puts a message useful for debugging only. This message is
// related to a given error.
DebugError(msg string, err error) DebugError(msg string, err error)
} }