func Infof(template string, args ...interface{}) {
	Get().Infof(template, args...)
}
Infof uses fmt.Sprintf to log a templated message.
package log
import (
	"fmt"
	"sync/atomic"
	"go.uber.org/zap"
)
var log atomic.Value
type Config struct {
	Debug bool `yaml:"debug" json:"debug" description:"enable debug logs"`
}
func init() {
	config := zap.NewProductionConfig()
	logger, err := config.Build()
	if err != nil {
		panic("Unable to create logger")
	}
	Set(logger.Sugar())
}
func Setup(config Config) {
	if err := Build(config); err != nil {
		panic(err)
	}
}
type Logger interface {
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	Fatalf(template string, args ...interface{})
}
func Set(logger Logger) {
	log.Store(logger)
}
func NewLogger(config Config) (Logger, error) {
	var cfg zap.Config
	if config.Debug {
		cfg = zap.NewDevelopmentConfig()
	} else {
		cfg = zap.NewProductionConfig()
	}
	logger, err := cfg.Build()
	if err != nil {
		return nil, err
	}
	return logger.Sugar(), nil
}
func Build(config Config) error {
	logger, err := NewLogger(config)
	if err != nil {
		return fmt.Errorf("logger creation failed: %w", err)
	}
	Set(logger)
	return nil
}
func Get() Logger {
	return log.Load().(Logger)
}
func Debug(args ...interface{}) {
	Get().Debug(args...)
}
func Info(args ...interface{}) {
	Get().Info(args...)
}
func Warn(args ...interface{}) {
	Get().Warn(args...)
}
func Error(args ...interface{}) {
	Get().Error(args...)
}
func Fatal(args ...interface{}) {
	Get().Fatal(args...)
}
func Debugf(template string, args ...interface{}) {
	Get().Debugf(template, args...)
}