-
Notifications
You must be signed in to change notification settings - Fork 0
/
application_logger.go
35 lines (27 loc) · 915 Bytes
/
application_logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package logger
import (
"context"
application "github.com/debugger84/modulus-application"
"go.uber.org/zap"
)
type applicationLogger struct {
zapLogger *zap.Logger
}
func NewApplicationLogger(zapLogger *zap.Logger) application.Logger {
return &applicationLogger{zapLogger: zapLogger}
}
func (a *applicationLogger) Warn(ctx context.Context, s string, i ...interface{}) {
a.zapLogger.Sugar().Warnw(s, i...)
}
func (a *applicationLogger) Info(ctx context.Context, s string, i ...interface{}) {
a.zapLogger.Sugar().Infow(s, i...)
}
func (a *applicationLogger) Error(ctx context.Context, s string, i ...interface{}) {
a.zapLogger.Sugar().Errorw(s, i...)
}
func (a *applicationLogger) Debug(ctx context.Context, s string, i ...interface{}) {
a.zapLogger.Sugar().Debugw(s, i...)
}
func (a *applicationLogger) Panic(ctx context.Context, s string, i ...interface{}) {
a.zapLogger.Sugar().Panicw(s, i...)
}