From e804cee2295d50c1724d30eb90e91989b314a9b9 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Wed, 27 May 2026 15:20:53 -0700 Subject: [PATCH] refactor: use slog instead of logrus --- go/go.mod | 2 +- go/internal/utils/env.go | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/go/go.mod b/go/go.mod index 2f54f7f..acc81d9 100644 --- a/go/go.mod +++ b/go/go.mod @@ -13,7 +13,6 @@ require ( github.com/livekit/protocol v1.45.1 github.com/livekit/server-sdk-go/v2 v2.16.1 github.com/redis/go-redis/v9 v9.17.2 - github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.11.1 github.com/stripe/stripe-go/v85 v85.0.1 github.com/testcontainers/testcontainers-go v0.40.0 @@ -148,6 +147,7 @@ require ( github.com/prometheus/procfs v0.19.2 // indirect github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect github.com/shirou/gopsutil/v4 v4.25.6 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect diff --git a/go/internal/utils/env.go b/go/internal/utils/env.go index 125c241..568d3ef 100644 --- a/go/internal/utils/env.go +++ b/go/internal/utils/env.go @@ -2,8 +2,7 @@ package utils import ( "os" - - "github.com/sirupsen/logrus" + "log/slog" ) // EnvVar enumerates the env vars referenced via this package. @@ -16,7 +15,7 @@ func MustGetEnv[T string | EnvVar](key T) string { keyString := string(key) value := os.Getenv(keyString) if value == "" { - logrus.Errorf("Missing required environment variable %s", key) + slog.Errorf("Missing required environment variable %s", key) panic("Missing required environment variable") } @@ -27,7 +26,7 @@ func MustGetEnv[T string | EnvVar](key T) string { func GetEnv(key string) string { value := os.Getenv(key) if value == "" { - logrus.Warnf("Missing optional environment variable %s", key) + slog.Warnf("Missing optional environment variable %s", key) } return value }