Documentation ¶
Index ¶
- Variables
- func AddFields(ctx context.Context, fields ...zapcore.Field) context.Context
- func Debug(ctx context.Context, msg string, fields ...zap.Field)
- func Error(ctx context.Context, msg string, fields ...zap.Field)
- func Exit(err error) int
- func FromContext(ctx context.Context) *zap.Logger
- func Info(ctx context.Context, msg string, fields ...zap.Field)
- func ToContext(ctx context.Context, l *zap.Logger) context.Context
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- type Config
- type LoggingError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Debug ¶
Debug is equivalent to calling Debug on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.
func Error ¶
Error is equivalent to calling Error on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.
func Exit ¶
Exit returns an exit code. if err is nil, 0 is returned. If err is set, the error is logged.
Types ¶
type LoggingError ¶
type LoggingError struct {
// contains filtered or unexported fields
}
LoggingError wraps an error with a logger
func NewLoggingError ¶
func NewLoggingError(logger *zap.Logger, message string, err error) *LoggingError
Create a new logging error
func (*LoggingError) Error ¶
func (l *LoggingError) Error() string
Click to show internal directories.
Click to hide internal directories.