Documentation ¶
Index ¶
- Constants
- func Alert(v ...interface{})
- func Alertf(format string, v ...interface{})
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Disable()
- func Emergency(v ...interface{})
- func Emergencyf(format string, v ...interface{})
- func Enable()
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func GetLevel() int
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Log(level int, v ...interface{})
- func Logf(level int, format string, v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func SetLevel(level int)
- func SetOutput(w io.Writer)
- func ValueToLogString(value interface{}) (result string, err error)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type RequestLogger
- func (r RequestLogger) Alert(v ...interface{})
- func (r RequestLogger) Alertf(format string, v ...interface{})
- func (r RequestLogger) Critical(v ...interface{})
- func (r RequestLogger) Criticalf(format string, v ...interface{})
- func (r RequestLogger) Debug(v ...interface{})
- func (r RequestLogger) Debugf(format string, v ...interface{})
- func (r RequestLogger) Emergency(v ...interface{})
- func (r RequestLogger) Emergencyf(format string, v ...interface{})
- func (r RequestLogger) Error(v ...interface{})
- func (r RequestLogger) Errorf(format string, v ...interface{})
- func (r RequestLogger) Info(v ...interface{})
- func (r RequestLogger) Infof(format string, v ...interface{})
- func (r RequestLogger) Log(level int, v ...interface{})
- func (r RequestLogger) Notice(v ...interface{})
- func (r RequestLogger) Noticef(format string, v ...interface{})
- func (r RequestLogger) RID() string
- func (r RequestLogger) Warning(v ...interface{})
- func (r RequestLogger) Warningf(format string, v ...interface{})
Constants ¶
const ( NOTSET = iota - 1 EMERGENCY ALERT CRITICAL ERROR WARNING NOTICE INFO DEBUG )
These flags define the error levels following RFC5425. See https://tools.ietf.org/html/rfc5424/.
Variables ¶
This section is empty.
Functions ¶
func Criticalf ¶
func Criticalf(format string, v ...interface{})
Criticalf logs a critical message with format.
func Emergencyf ¶
func Emergencyf(format string, v ...interface{})
Emergencyf logs a emergency message with format.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf logs an error message with format.
func Noticef ¶
func Noticef(format string, v ...interface{})
Noticef logs a notice message with format.
func ValueToLogString ¶
ValueToLogString returns a string representation of a value.
Types ¶
type RequestLogger ¶
type RequestLogger struct {
// contains filtered or unexported fields
}
RequestLogger is a logger with request ID support. The request ID is added to every log message written using this logger.
func NewRequestLogger ¶
func NewRequestLogger(rid string) RequestLogger
NewRequestLogger creates a new logger wuth request ID support.
func (RequestLogger) Alert ¶
func (r RequestLogger) Alert(v ...interface{})
Alert logs an alert message.
func (RequestLogger) Alertf ¶
func (r RequestLogger) Alertf(format string, v ...interface{})
Alertf logs a alert message with format.
func (RequestLogger) Critical ¶
func (r RequestLogger) Critical(v ...interface{})
Critical logs a critical message.
func (RequestLogger) Criticalf ¶
func (r RequestLogger) Criticalf(format string, v ...interface{})
Criticalf logs a critical message with format.
func (RequestLogger) Debug ¶
func (r RequestLogger) Debug(v ...interface{})
Debug logs a debug message.
func (RequestLogger) Debugf ¶
func (r RequestLogger) Debugf(format string, v ...interface{})
Debugf logs a debug message with format.
func (RequestLogger) Emergency ¶
func (r RequestLogger) Emergency(v ...interface{})
Emergency logs an emergency message.
func (RequestLogger) Emergencyf ¶
func (r RequestLogger) Emergencyf(format string, v ...interface{})
Emergencyf logs a emergency message with format.
func (RequestLogger) Error ¶
func (r RequestLogger) Error(v ...interface{})
Error logs an error message.
func (RequestLogger) Errorf ¶
func (r RequestLogger) Errorf(format string, v ...interface{})
Errorf logs an error message with format.
func (RequestLogger) Info ¶
func (r RequestLogger) Info(v ...interface{})
Info logs an info message.
func (RequestLogger) Infof ¶
func (r RequestLogger) Infof(format string, v ...interface{})
Infof logs an info message with format.
func (RequestLogger) Notice ¶
func (r RequestLogger) Notice(v ...interface{})
Notice logs a notice message.
func (RequestLogger) Noticef ¶
func (r RequestLogger) Noticef(format string, v ...interface{})
Noticef logs a notice message with format.
func (RequestLogger) Warning ¶
func (r RequestLogger) Warning(v ...interface{})
Warning logs a warning message.
func (RequestLogger) Warningf ¶
func (r RequestLogger) Warningf(format string, v ...interface{})
Warningf logs a warning message with format.