feat: add logrus logger
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user