Documentation ¶
Index ¶
- func Close()
- func Debug(format string, a ...interface{})
- func Error(format string, a ...interface{})
- func Fatal(err error)
- func Global(l Logger)
- func Info(format string, a ...interface{})
- func Trace(format string, a ...interface{})
- func Warn(format string, a ...interface{})
- func WriteEscapedJSON(content string, output *bytes.Buffer)
- type Config
- type FieldsContext
- func (f FieldsContext) Debug(format string, a ...interface{})
- func (f FieldsContext) Error(format string, a ...interface{})
- func (f FieldsContext) Fatal(err error)
- func (f FieldsContext) Info(format string, a ...interface{})
- func (f FieldsContext) Trace(format string, a ...interface{})
- func (f FieldsContext) Warn(format string, a ...interface{})
- func (f FieldsContext) WithField(name string, value interface{}) FieldsContext
- type Logger
- func (l Logger) Close()
- func (l Logger) Debug(format string, a ...interface{})
- func (l Logger) Debugf(format string, a ...interface{})
- func (l Logger) Error(format string, a ...interface{})
- func (l Logger) Errorf(format string, a ...interface{})
- func (l Logger) Fatal(err error)
- func (l Logger) Info(format string, a ...interface{})
- func (l Logger) Infof(format string, a ...interface{})
- func (l Logger) Start()
- func (l Logger) Trace(format string, a ...interface{})
- func (l Logger) Warn(format string, a ...interface{})
- func (l Logger) Warningf(format string, a ...interface{})
- func (l Logger) WithField(name string, value interface{}) FieldsContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteEscapedJSON ¶ added in v4.22.4
WriteEscapedJSON escapes value from raw string to be JSON compatible
Types ¶
type FieldsContext ¶ added in v4.7.0
type FieldsContext struct {
// contains filtered or unexported fields
}
FieldsContext contains field context
func WithField ¶ added in v4.7.1
func WithField(name string, value interface{}) FieldsContext
WithField create context for logging
func (FieldsContext) Debug ¶ added in v4.7.0
func (f FieldsContext) Debug(format string, a ...interface{})
Debug logs debug message
func (FieldsContext) Error ¶ added in v4.7.0
func (f FieldsContext) Error(format string, a ...interface{})
Error logs error message
func (FieldsContext) Fatal ¶ added in v4.7.0
func (f FieldsContext) Fatal(err error)
Fatal logs error message and exit with status code 1
func (FieldsContext) Info ¶ added in v4.7.0
func (f FieldsContext) Info(format string, a ...interface{})
Info logs info message
func (FieldsContext) Trace ¶ added in v4.7.0
func (f FieldsContext) Trace(format string, a ...interface{})
Trace logs tracing message
func (FieldsContext) Warn ¶ added in v4.7.0
func (f FieldsContext) Warn(format string, a ...interface{})
Warn logs warning message
func (FieldsContext) WithField ¶ added in v4.7.0
func (f FieldsContext) WithField(name string, value interface{}) FieldsContext
WithField add a field to current context
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger defines a logger instance
func (Logger) WithField ¶ added in v4.7.0
func (l Logger) WithField(name string, value interface{}) FieldsContext
WithField add given name and value to a context
Click to show internal directories.
Click to hide internal directories.