v0.4.0
This commit is contained in:
11
utils.go
11
utils.go
@@ -3,9 +3,20 @@ package laniakea
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.nix13.pw/scuroneko/slog"
|
||||
)
|
||||
|
||||
func GetLoggerLevel() slog.LogLevel {
|
||||
level := slog.FATAL
|
||||
if os.Getenv("DEBUG") == "true" {
|
||||
level = slog.DEBUG
|
||||
}
|
||||
return level
|
||||
}
|
||||
|
||||
// MapToStruct unsafe function
|
||||
func MapToStruct(m map[string]any, s any) error {
|
||||
data, err := json.Marshal(m)
|
||||
|
||||
Reference in New Issue
Block a user