Documentation ¶
Index ¶
- func CreateContext(ctx context.Context, fields ...zap.Field) (context.Context, *zap.Logger)
- func CreateContextNop(ctx context.Context, fields ...zap.Field) context.Context
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func Init(v bool)
- func Panic(msg string, fields ...zap.Field)
- func Warn(msg string, fields ...zap.Field)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateContext ¶
CreateContext returns a new logger with the given fields tagged to the logger, and the context containing this logger.
func CreateContextNop ¶
CreateContextNop adds a noop logger to the context.
func Init ¶
func Init(v bool)
Init initializes logging, based on we want verbose, or simple logs. Nonverbose logs go to a temporary file only, and the user get a nice message about everything from Info to Error.
Types ¶
type Logger ¶
Logger is a wrapper for zap logger that may have custom functions on it.
func WithContext ¶
WithContext returns a logger related to the given context.
func (Logger) Debug ¶
Debug wraps printing a nice message to the user, and logging the debug to the zap logger.
func (Logger) Error ¶
Error wraps printing a nice message to the user, and logging the error to the zap logger.