package logger import ( "github.com/Neur0toxine/sshpoke/internal/config" "go.uber.org/zap" ) var ( Default *zap.Logger Sugar *zap.SugaredLogger ) func Initialize() { Default = New(config.DefaultConfig.Debug) Sugar = Default.Sugar() } func New(debug bool) *zap.Logger { if debug { logger, _ := zap.NewDevelopment() return logger } zapConfig := zap.NewProductionConfig() zapConfig.Encoding = "console" logger, _ := zapConfig.Build() return logger }