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 SafeCloseCtx(ctx context.Context, c io.Closer, msg string, fields ...zapcore.Field)
- func SetLoggerFactory(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 CheckErr ¶
CheckErr handles error correctly
func CheckErrCtx ¶
CheckErrCtx handles error correctly
func SafeClose ¶
SafeClose handles the closer error
func SafeCloseCtx ¶ added in v0.1.0
SafeCloseCtx handles the closer error
func SetLoggerFactory ¶ added in v0.1.1
func SetLoggerFactory(instance LoggerFactory)
SetLoggerFactory 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
Click to show internal directories.
Click to hide internal directories.