func SetFatalExiter(fef FatalExiterFunc) FatalExiterFunc {
	logMux.Lock()
	defer logMux.Unlock()
	current := logFatalExiter
	logFatalExiter = fef
	return current
}
SetFatalExiter sets the fatal exiter function and
returns the current one.
package logger
import (
	"fmt"
	"io"
	"log"
	"os"
	"path"
	"runtime"
	"strings"
	"sync"
	"time"
)
type LogLevel int
const (
	LevelDebug LogLevel = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelCritical
	LevelFatal
)
type FatalExiterFunc func()
func OsFatalExiter() {
	os.Exit(-1)
}
func PanicFatalExiter() {
	panic("program aborted after fatal situation, see log")
}
type FilterFunc func(level LogLevel, info, msg string) bool
var (
	logMux         sync.RWMutex
	logLevel       LogLevel        = LevelInfo
	logBackend     Logger          = NewStandardLogger(os.Stdout)
	logFatalExiter FatalExiterFunc = OsFatalExiter
	logFilter      FilterFunc
)
func Level() LogLevel {
	logMux.Lock()
	defer logMux.Unlock()
	return logLevel
}
func SetLevel(level LogLevel) LogLevel {
	logMux.Lock()
	defer logMux.Unlock()
	current := logLevel
	switch {
	case level <= LevelDebug:
		logLevel = LevelDebug
	case level >= LevelFatal:
		logLevel = LevelFatal
	default:
		logLevel = level
	}
	return current
}
func SetLevelString(levelstr string) LogLevel {
	logMux.Lock()
	defer logMux.Unlock()
	current := logLevel
	switch strings.ToLower(levelstr) {
	case "debug":
		logLevel = LevelDebug
	case "info":
		logLevel = LevelInfo
	case "warning":
		logLevel = LevelWarning
	case "error":
		logLevel = LevelError
	case "critical":
		logLevel = LevelCritical
	case "fatal":
		logLevel = LevelFatal
	}
	return current
}
func SetLogger(l Logger) Logger {
	logMux.Lock()
	defer logMux.Unlock()
	old := logBackend
	logBackend = l
	return old
}