refactor: use slog instead of logrus

This commit is contained in:
Arjun Patel
2026-05-27 15:20:53 -07:00
parent 72bc41733f
commit e804cee229
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -13,7 +13,6 @@ require (
github.com/livekit/protocol v1.45.1 github.com/livekit/protocol v1.45.1
github.com/livekit/server-sdk-go/v2 v2.16.1 github.com/livekit/server-sdk-go/v2 v2.16.1
github.com/redis/go-redis/v9 v9.17.2 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/stretchr/testify v1.11.1
github.com/stripe/stripe-go/v85 v85.0.1 github.com/stripe/stripe-go/v85 v85.0.1
github.com/testcontainers/testcontainers-go v0.40.0 github.com/testcontainers/testcontainers-go v0.40.0
@@ -148,6 +147,7 @@ require (
github.com/prometheus/procfs v0.19.2 // indirect github.com/prometheus/procfs v0.19.2 // indirect
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
github.com/shirou/gopsutil/v4 v4.25.6 // 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/spiffe/go-spiffe/v2 v2.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect github.com/tklauser/numcpus v0.6.1 // indirect
+3 -4
View File
@@ -2,8 +2,7 @@ package utils
import ( import (
"os" "os"
"log/slog"
"github.com/sirupsen/logrus"
) )
// EnvVar enumerates the env vars referenced via this package. // EnvVar enumerates the env vars referenced via this package.
@@ -16,7 +15,7 @@ func MustGetEnv[T string | EnvVar](key T) string {
keyString := string(key) keyString := string(key)
value := os.Getenv(keyString) value := os.Getenv(keyString)
if value == "" { if value == "" {
logrus.Errorf("Missing required environment variable %s", key) slog.Errorf("Missing required environment variable %s", key)
panic("Missing required environment variable") panic("Missing required environment variable")
} }
@@ -27,7 +26,7 @@ func MustGetEnv[T string | EnvVar](key T) string {
func GetEnv(key string) string { func GetEnv(key string) string {
value := os.Getenv(key) value := os.Getenv(key)
if value == "" { if value == "" {
logrus.Warnf("Missing optional environment variable %s", key) slog.Warnf("Missing optional environment variable %s", key)
} }
return value return value
} }