refactor: use slog instead of logrus
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user