Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAppLogger ¶
func NewAppLogger(cfg config.ILoggerConfig) *appLogger
NewAppLogger ScreamingApp IAppLogger constructor
func NoCallerEncoder ¶
func NoCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
func WithLogger ¶
func WithLogger(ctx context.Context, log IAppLogger) context.Context
WithLogger embeds logger into the drivers.
Types ¶
type IAppLogger ¶
type IAppLogger interface { InitLogger() Sync() error Debug(args ...interface{}) Debugf(template string, args ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Warn(args ...interface{}) Warnf(template string, args ...interface{}) WarnMsg(msg string, err error) Error(args ...interface{}) Errorf(template string, args ...interface{}) Err(msg string, err error) DPanic(args ...interface{}) DPanicf(template string, args ...interface{}) Fatal(args ...interface{}) Fatalf(template string, args ...interface{}) Printf(template string, args ...interface{}) WithName(name string) HttpMiddlewareAccessLogger(method string, uri string, status int, size int64, time time.Duration) GrpcMiddlewareAccessLogger(method string, time time.Duration, metaData map[string][]string, err error) GrpcClientInterceptorLogger(method string, req interface{}, reply interface{}, time time.Duration, metaData map[string][]string, err error) KafkaProcessMessage(topic string, partition int, message string, workerID int, offset int64, time time.Time) KafkaLogCommittedMessage(topic string, partition int, offset int64) }
IAppLogger is the Injector for logging functionality.
var Discard IAppLogger = new(discardLogger)
Discard is a logger that is notdoing anything.
func AppLogger ¶
func AppLogger(cfg config.IAppConfig) IAppLogger
AppLogger is an injection for the IApplogger injector and provides extensive logging capabilities based on zap
func GetLogger ¶
func GetLogger(ctx context.Context) IAppLogger
GetLogger retrieves logger from the drivers. It always returns logger instance.
Click to show internal directories.
Click to hide internal directories.