Documentation ¶
Overview ¶
Package log implements a simple set of leveled logging wrappers around the standard log package.
Index ¶
- Constants
- func Debugf(format string, a ...interface{})
- func ElideAddr(addrStr string) string
- func ElideError(err error) string
- func Enabled() bool
- func Errorf(format string, a ...interface{})
- func Infof(format string, a ...interface{})
- func Init(enable bool, logFilePath string, unsafe bool) error
- func Level() int
- func Noticef(format string, a ...interface{})
- func SetLogLevel(logLevelStr string) error
- func Unsafe() bool
- func Warnf(format string, a ...interface{})
Constants ¶
const ( // LevelError is the ERROR log level (NOTICE/ERROR). LevelError = iota // LevelWarn is the WARN log level, (NOTICE/ERROR/WARN). LevelWarn // LevelInfo is the INFO log level, (NOTICE/ERROR/WARN/INFO). LevelInfo // LevelDebug is the DEBUG log level, (NOTICE/ERROR/WARN/INFO/DEBUG). LevelDebug )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, a ...interface{})
Debugf logs the given format string/arguments at the DEBUG log level.
func ElideAddr ¶
ElideAddr transforms the string representation of the provided address based on the unsafeLogging setting. Callers that wish to log IP addreses should use ElideAddr to sanitize the contents first.
func ElideError ¶
ElideError transforms the string representation of the provided error based on the unsafeLogging setting. Callers that wish to log errors returned from Go's net package should use ElideError to sanitize the contents first.
func Errorf ¶
func Errorf(format string, a ...interface{})
Errorf logs the given format string/arguments at the ERROR log level.
func Infof ¶
func Infof(format string, a ...interface{})
Infof logs the given format string/arguments at the INFO log level.
func Init ¶
Init initializes logging with the given path, and log safety options.
func Noticef ¶
func Noticef(format string, a ...interface{})
Noticef logs the given format string/arguments at the NOTICE log level. Unless logging is disabled, Noticef logs are always emitted.
func SetLogLevel ¶
SetLogLevel sets the log level to the value indicated by the given string (case-insensitive).
Types ¶
This section is empty.