Documentation ¶
Index ¶
- Variables
- func CheckErr(msg string, err error, fields ...zapcore.Field)
- func CheckErrCtx(ctx context.Context, msg string, err error, fields ...zapcore.Field)
- func SafeClose(c io.Closer, msg string, fields ...zapcore.Field)
- func SetLogger(instance LoggerFactory)
- func Setup(ctx context.Context, opts *Options)
- type Logger
- type LoggerFactory
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = &Options{ Debug: false, LogLevel: "info", AppName: "changeme", AppID: "changeme", Version: "0.0.1", Revision: "123456789", SentryDSN: "", }
DefaultOptions defines default logger options
Functions ¶
func CheckErrCtx ¶
CheckErrCtx handles error correctly
func SetLogger ¶
func SetLogger(instance LoggerFactory)
SetLogger defines the default package logger
Types ¶
type Logger ¶
type Logger interface { Debug(msg string, fields ...zapcore.Field) Info(msg string, fields ...zapcore.Field) Warn(msg string, fields ...zapcore.Field) Error(msg string, fields ...zapcore.Field) Fatal(msg string, fields ...zapcore.Field) With(fields ...zapcore.Field) Logger }
Logger is a simplified abstraction of the zap.Logger
type LoggerFactory ¶
type LoggerFactory interface { Bg() Logger For(context.Context) Logger With(...zapcore.Field) LoggerFactory }
LoggerFactory defines logger factory contract
func NewFactory ¶
func NewFactory(logger *zap.Logger) LoggerFactory
NewFactory creates a new Factory.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package grpczaphelper implements multiple helper function
|
Package grpczaphelper implements multiple helper function |
Click to show internal directories.
Click to hide internal directories.