e1.0.1 Minor feature add, file restructure.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
// --- File: utility.go ---
|
||||
package log
|
||||
|
||||
import (
|
||||
@ -141,8 +142,8 @@ func validateConfigValue(key string, value interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// parseLevel converts level string to numeric constant.
|
||||
func parseLevel(levelStr string) (int64, error) {
|
||||
// Level converts level string to numeric constant.
|
||||
func Level(levelStr string) (int64, error) {
|
||||
switch strings.ToLower(strings.TrimSpace(levelStr)) {
|
||||
case "debug":
|
||||
return LevelDebug, nil
|
||||
@ -155,4 +156,4 @@ func parseLevel(levelStr string) (int64, error) {
|
||||
default:
|
||||
return 0, fmtErrorf("invalid level string: '%s' (use debug, info, warn, error)", levelStr)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user