e1.0.1 Minor feature add, file restructure.

This commit is contained in:
2025-04-22 18:48:29 -04:00
parent b78da2b449
commit c809396455
11 changed files with 411 additions and 316 deletions

View File

@ -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)
}
}
}