Documentation ¶
Overview ¶
Package zephyrus provides commonly used logging functions by wrapping the uber-go/zap package.
Index ¶
- func NewContextWithLogger(parentCtx context.Context, logger *Logger) context.Context
- type Field
- type Logger
- func (l *Logger) Clean()
- func (l *Logger) Debug(msg string)
- func (l *Logger) Error(msg string)
- func (l *Logger) Fatal(msg string)
- func (l *Logger) Info(msg string)
- func (l *Logger) Warn(msg string)
- func (l *Logger) WithError(err error) *Logger
- func (l *Logger) WithField(key string, val interface{}) *Logger
- func (l *Logger) WithFields(fields []Field) *Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger wraps zap.Logger.
func New ¶
New creates a new logger. Make sure to call defer logger.Clean() after calling this. TODO: Benchmarking
func NewLoggerFromContext ¶
NewLoggerFromContext retrieves a logger from a context and panics if there isn't one.
func (*Logger) Clean ¶
func (l *Logger) Clean()
Clean cleans up the log states. Make sure to call this after creating a new logger.
func (*Logger) WithError ¶
WithError returns a logger with the current error padded. TODO: How to append this error?
func (*Logger) WithFields ¶
WithFields returns a logger with the providedfields.
Click to show internal directories.
Click to hide internal directories.