func (l *Logger) Warn(args ...interface{}) {
	l.entry().commit(WarnLevel, fmt.Sprint(args...))
}
Warn implements log.Interface.
package log
import (
	"fmt"
	"os"
	"sync"
)
func NewLogger(handler Handler, opts ...Option) *Logger {
	logger := &Logger{
		Level:   InfoLevel,
		Handler: handler,
	}
	for _, opt := range opts {
		opt(logger)
	}
	return logger
}
type Logger struct {
	mutex      sync.RWMutex
	Level      Level
	Handler    Handler
	middleware []Middleware
	stack      Handler
}
func (l *Logger) Use(middleware Middleware) {
	l.mutex.Lock()
	defer l.mutex.Unlock()
	l.middleware = append(l.middleware, middleware)
	handler := Handler(HandlerFunc(func(entry Entry) error {
		return l.Handler.HandleLog(entry)
	}))
	for i := len(l.middleware) - 1; i >= 0; i-- {
		handler = l.middleware[i].Wrap(handler)
	}
	l.stack = handler
}
func (l *Logger) commit(e *entry) {
	handler := l.stack
	if handler == nil {
		handler = l.Handler
	}
	if handler != nil && l.Level <= e.level {
		l.mutex.RLock()
		defer l.mutex.RUnlock()
		_ = handler.HandleLog(e)
	}
	if e.Level() == FatalLevel {
		os.Exit(1)
	}
}
func (l *Logger) Debug(args ...interface{}) {
	l.entry().commit(DebugLevel, fmt.Sprint(args...))
}
func (l *Logger) Info(args ...interface{}) {
	l.entry().commit(InfoLevel, fmt.Sprint(args...))
}