func (ll *DefaultLeveledLogger) Debug(msg string) {
	ll.logf(ll.debug, LogLevelDebug, msg)
}
Debug emits the preformatted message if the logger is at or below LogLevelDebug
package logging
import (
	"fmt"
	"io"
	"log"
	"os"
	"strings"
	"sync"
)
type loggerWriter struct {
	sync.RWMutex
	output io.Writer
}
func (lw *loggerWriter) SetOutput(output io.Writer) {
	lw.Lock()
	defer lw.Unlock()
	lw.output = output
}
func (lw *loggerWriter) Write(data []byte) (int, error) {
	lw.RLock()
	defer lw.RUnlock()
	return lw.output.Write(data)
}
type DefaultLeveledLogger struct {
	level  LogLevel
	writer *loggerWriter
	trace  *log.Logger
	debug  *log.Logger
	info   *log.Logger
	warn   *log.Logger
	err    *log.Logger
}
func (ll *DefaultLeveledLogger) WithTraceLogger(log *log.Logger) *DefaultLeveledLogger {
	ll.trace = log
	return ll
}
func (ll *DefaultLeveledLogger) WithDebugLogger(log *log.Logger) *DefaultLeveledLogger {
	ll.debug = log
	return ll
}
func (ll *DefaultLeveledLogger) WithInfoLogger(log *log.Logger) *DefaultLeveledLogger {
	ll.info = log
	return ll
}
func (ll *DefaultLeveledLogger) WithWarnLogger(log *log.Logger) *DefaultLeveledLogger {
	ll.warn = log
	return ll
}
func (ll *DefaultLeveledLogger) WithErrorLogger(log *log.Logger) *DefaultLeveledLogger {
	ll.err = log
	return ll
}
func (ll *DefaultLeveledLogger) WithOutput(output io.Writer) *DefaultLeveledLogger {
	ll.writer.SetOutput(output)
	return ll
}
func (ll *DefaultLeveledLogger) logf(logger *log.Logger, level LogLevel, format string, args ...interface{}) {
	if ll.level.Get() < level {
		return
	}
	callDepth := 3  
	msg := fmt.Sprintf(format, args...)
	if err := logger.Output(callDepth, msg); err != nil {
		fmt.Fprintf(os.Stderr, "Unable to log: %s", err)
	}
}
func (ll *DefaultLeveledLogger) SetLevel(newLevel LogLevel) {
	ll.level.Set(newLevel)
}
func (ll *DefaultLeveledLogger) Trace(msg string) {
	ll.logf(ll.trace, LogLevelTrace, msg)
}
func (ll *DefaultLeveledLogger) Tracef(format string, args ...interface{}) {
	ll.logf(ll.trace, LogLevelTrace, format, args...)
}