feat: Initial revision

This commit is contained in:
Adrian Rumpold
2022-07-04 06:51:34 +02:00
commit 0054a2d9ae
13 changed files with 468 additions and 0 deletions

24
internal/util/util.go Normal file
View File

@@ -0,0 +1,24 @@
package util
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var Logger *zap.SugaredLogger
func InitializeLogging(development bool) {
var cfg zap.Config
if development {
cfg = zap.NewDevelopmentConfig()
cfg.EncoderConfig.EncodeTime = zapcore.RFC3339TimeEncoder
} else {
cfg = zap.NewProductionConfig()
}
l, err := cfg.Build()
if err != nil {
panic(err)
}
Logger = l.Sugar()
}