func (b *BasicLogger) LogDebug(fields map[string]interface{}, format string, args ...interface{}) {
	b.logger.Debug().Fields(fields).Msgf(format, args...)
}
LogDebug print a message with debug level.
package logger
import (
	"fmt"
	"os"
	"path"
	"runtime"
	"strings"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/rs/zerolog"
	"github.com/rs/zerolog/log"
	"github.com/spf13/pflag"
)
type Logger interface {
	LogDebug(fields map[string]interface{}, format string, args ...interface{})
	LogInfo(fields map[string]interface{}, format string, args ...interface{})
	LogWarn(fields map[string]interface{}, format string, args ...interface{})
	LogError(fields map[string]interface{}, format string, args ...interface{})
	LogFatal(fields map[string]interface{}, format string, args ...interface{})
	NewLogger(component string) Logger
	SetLogLevel(verbosity string)
}
type BasicLogger struct {
	cfg *Config
	component  string
	logger     zerolog.Logger
	registerer prometheus.Registerer
}
type Config struct {
	Pretty bool
	Level  string
}
func NewConfig() *Config {
	return &Config{
		Pretty: true,
		Level:  "debug",
	}
}
func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet) {
	f.StringVar(&c.Level, prefix+"log.level", c.Level, "log level(debug, info, warn, error, fatal)")
	f.BoolVar(&c.Pretty, prefix+"log.pretty", c.Pretty, "log in a pretty format")
}
func NewDefault(component string) Logger {
	logger, err := New(NewConfig(), component, prometheus.DefaultRegisterer)
	if err != nil {
		panic(err)
	}
	return logger
}
func New(cfg *Config, component string, registerer prometheus.Registerer) (Logger, error) {
	if cfg == nil {
		cfg = NewConfig()
	}
	service := &BasicLogger{
		cfg:        cfg,
		component:  component,
		registerer: registerer,
	}
	service.setup()
	return service, nil
}
func (b *BasicLogger) setup() {
	b.logger = log.With().Str("component", b.component).Logger().Hook(CallerHook{})
	if b.cfg != nil {
		if b.cfg.Pretty {
			b.logger = b.logger.Output(zerolog.ConsoleWriter{
				Out: os.Stdout,
			})
		}
		b.SetLogLevel(b.cfg.Level)
	}
}