From 10bcfe65b21a50298e3a8312a01b565dc1003ebe Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sat, 7 Sep 2024 22:31:13 +0300 Subject: [PATCH] Migrate utils --- mycoopts/mycoopts.go | 4 +++- util/util.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mycoopts/mycoopts.go b/mycoopts/mycoopts.go index bd1d9f2..7fe78a8 100644 --- a/mycoopts/mycoopts.go +++ b/mycoopts/mycoopts.go @@ -2,11 +2,13 @@ package mycoopts import ( "errors" - "git.sr.ht/~bouncepaw/mycomarkup/v5/options" + "github.com/bouncepaw/mycorrhiza/internal/cfg" "github.com/bouncepaw/mycorrhiza/internal/hyphae" "github.com/bouncepaw/mycorrhiza/interwiki" "github.com/bouncepaw/mycorrhiza/util" + + "git.sr.ht/~bouncepaw/mycomarkup/v5/options" ) func MarkupOptions(hyphaName string) options.Options { diff --git a/util/util.go b/util/util.go index 499697b..7cdd404 100644 --- a/util/util.go +++ b/util/util.go @@ -3,7 +3,7 @@ package util import ( "crypto/rand" "encoding/hex" - "log" + "log/slog" "net/http" "strings" @@ -82,7 +82,7 @@ func HyphaNameFromRq(rq *http.Request, actions ...string) string { return CanonicalName(strings.TrimPrefix(p, "/"+action+"/")) } } - log.Println("HyphaNameFromRq: this request is invalid, fall back to home hypha") + slog.Info("HyphaNameFromRq: this request is invalid, fall back to home hypha") return cfg.HomeHypha }