func LogLevel(level string) (Level, error) {
	for i, name := range levelNames {
		if strings.EqualFold(name, level) {
			return Level(i), nil
		}
	}
	return ERROR, ErrInvalidLogLevel
}
LogLevel returns the log level from a string representation.
package logging
import (
	"errors"
	"strings"
	"sync"
)
var ErrInvalidLogLevel = errors.New("logger: invalid log level")
type Level int
const (
	CRITICAL Level = iota
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
)
var levelNames = []string{
	"CRITICAL",
	"ERROR",
	"WARNING",
	"NOTICE",
	"INFO",
	"DEBUG",
}
func (p Level) String() string {
	return levelNames[p]
}