func (logger *Logger) Fatal(msg string, args ...interface{}) {
	logger.Log(msg, LevelFatal, args...)
}
Fatal message helper function
package memfs
import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"strings"
	"time"
)
type LogLevel int
const (
	LevelDebug LogLevel = 1 + iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)
var levelNames = []string{
	"DEBUG", "INFO", "WARN", "ERROR", "FATAL",
}
func (level LogLevel) String() string {
	return levelNames[level-1]
}
func LevelFromString(level string) LogLevel {
	level = strings.ToUpper(level)
	level = strings.Trim(level, " ")
	switch level {
	case "DEBUG":
		return LevelDebug
	case "INFO":
		return LevelInfo
	case "WARN":
		return LevelWarn
	case "WARNING":
		return LevelWarn
	case "ERROR":
		return LevelError
	case "FATAL":
		return LevelFatal
	default:
		return LevelInfo
	}
}
type Logger struct {
	Level  LogLevel        
	logger *log.Logger     
	output io.WriteCloser  
}
func InitLogger(path string, level string) (*Logger, error) {
	newLogger := new(Logger)
	newLogger.Level = LevelFromString(level)
	if path != "" {
		var err error
		newLogger.output, err = os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
		if err != nil {
			return nil, err
		}
	} else {
		newLogger.output = os.Stdout
	}
	newLogger.logger = log.New(newLogger.output, "", 0)
	return newLogger, nil
}
func (logger *Logger) Close() error {
	if err := logger.output.Close(); err != nil {
		return err
	}
	return nil
}
func (logger *Logger) GetHandler() io.Writer {
	return logger.output
}
func (logger *Logger) SetHandler(writer io.WriteCloser) {
	logger.output = writer
	logger.logger.SetOutput(writer)
}
func (logger *Logger) Log(layout string, level LogLevel, args ...interface{}) {
	if level >= logger.Level {
		msg := fmt.Sprintf(layout, args...)
		msg = fmt.Sprintf("%-7s [%s]: %s", level, time.Now().Format(JSONDateTime), msg)
		if level == LevelFatal {
			logger.logger.Fatalln(msg)
		} else {
			logger.logger.Println(msg)
		}
	}
}
func (logger *Logger) Debug(msg string, args ...interface{}) {
	logger.Log(msg, LevelDebug, args...)
}
func (logger *Logger) Info(msg string, args ...interface{}) {
	logger.Log(msg, LevelInfo, args...)
}
func (logger *Logger) Warn(msg string, args ...interface{}) {
	logger.Log(msg, LevelWarn, args...)
}
func (logger *Logger) Error(msg string, args ...interface{}) {
	logger.Log(msg, LevelError, args...)
}