This commit is contained in:
2026-02-05 12:16:25 +03:00
parent 7a6f135487
commit 60f09e940a
11 changed files with 319 additions and 110 deletions

View File

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