infra: add logging wrapping

Resolves issues with gcp cloud logging quirks such as field names
This commit is contained in:
Arjun Patel
2026-05-27 15:49:27 -07:00
parent e804cee229
commit 563c91e7d5
30 changed files with 347 additions and 250 deletions
+6 -4
View File
@@ -3,17 +3,19 @@ package internal
import (
"context"
"fmt"
"log/slog"
"os"
"github.com/flowy-live/llink/internal/utils"
"github.com/flowy-live/llink/internal/utils/flog"
"github.com/redis/go-redis/v9"
"github.com/flowy-live/llink/internal/utils"
)
func ConnectAndTestRedis(db int) *redis.Client {
redisHost := utils.MustGetEnv("REDIS_HOST")
if redisHost == "" {
slog.Error("must provide REDIS_HOST")
flog.Error("must provide REDIS_HOST")
os.Exit(1)
}
redisAddr := fmt.Sprintf("%s:%s", redisHost, "6379")
@@ -32,7 +34,7 @@ func ConnectAndTestRedis(db int) *redis.Client {
if err != nil {
panic(err)
}
slog.Debug("redis test", "key", val)
flog.Debug("redis test", "key", val)
if val != "value" {
panic("unexpected value")
}