func ParseLevel(lvl string) Level {
	switch {
	case strings.EqualFold(lvl, debugLevelStr):
		return DebugLevel
	case strings.EqualFold(lvl, infoLevelStr):
		return InfoLevel
	case strings.EqualFold(lvl, warnLevelStr),
		strings.EqualFold(lvl, warningLevelStr):
		return WarnLevel
	case strings.EqualFold(lvl, errorLevelStr):
		return ErrorLevel
	case strings.EqualFold(lvl, fatalLevelStr):
		return FatalLevel
	case strings.EqualFold(lvl, panicLevelStr):
		return PanicLevel
	}
	return UnknownLevel
}
ParseLevel parses a string and returns its constant.
package gournal
import (
	"context"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var debug, _ = strconv.ParseBool(os.Getenv("GOURNAL_DEBUG"))
var (
	ErrorKey = "error"
	DefaultLevel = ErrorLevel
	DefaultAppender = NewAppender()
	DefaultContext = context.Background()
)
type contextKey uint8
const (
	levelKeyC contextKey = iota
	fieldsKeyC
	appenderKeyC
)
var (
	levelKey    interface{} = levelKeyC
	fieldsKey   interface{} = fieldsKeyC
	appenderKey interface{} = appenderKeyC
)
func LevelKey() interface{} {
	return levelKey
}
func FieldsKey() interface{} {
	return fieldsKey
}
func AppenderKey() interface{} {
	return appenderKey
}
type Level uint8
const (
	UnknownLevel Level = iota
	PanicLevel
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	levelCount
)
const (
	unknownLevelStr = "UNKNOWN"
	panicLevelStr   = "PANIC"
	fatalLevelStr   = "FATAL"
	errorLevelStr   = "ERROR"
	warnLevelStr    = "WARN"
	warningLevelStr = "WARNING"
	infoLevelStr    = "INFO"
	debugLevelStr   = "DEBUG"
)
var (
	lvlValsToStrs = [levelCount]string{
		unknownLevelStr,
		panicLevelStr,
		fatalLevelStr,
		errorLevelStr,
		warnLevelStr,
		infoLevelStr,
		debugLevelStr,
	}
)
func (level Level) String() string {
	if level < PanicLevel || level >= levelCount {
		return lvlValsToStrs[UnknownLevel]
	}
	return lvlValsToStrs[level]
}