feat: add logrus logger

This commit is contained in:
2026-03-30 16:59:45 -05:00
parent 5e23e20e5a
commit b3eb75646a
7 changed files with 38 additions and 22 deletions

View File

@@ -1,10 +1,10 @@
package config
import (
"log"
"os"
"github.com/joho/godotenv"
"github.com/sirupsen/logrus"
)
type dbConfig struct {
@@ -14,7 +14,7 @@ type dbConfig struct {
func loadEnv() {
err := godotenv.Load()
if err != nil {
log.Println("Warning: could not load .env file")
logrus.Warn("Warning: could not load .env file")
}
}
@@ -23,7 +23,7 @@ func getDbConfig() *dbConfig {
dbUrl := os.Getenv("PG_FROM_DB_URL")
if dbUrl == "" {
log.Fatal("PG_FROM_DB_URL environment variable not set")
logrus.Fatal("PG_FROM_DB_URL environment variable not set")
}
return &dbConfig{