You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we provide the -db flag without postgres running, we get this output
╰─$ go run main.go -json -bucket asdfasdf567 -enumerate -provider custom -db
[error] failed to initialize database, got error failed to connect to `host=db_dev user=postgres database=postgres`: hostname resolving error (lookup db_dev: no such host)
{"level":"error","msg":"failed to connect to `host=db_dev user=postgres database=postgres`: hostname resolving error (lookup db_dev: no such host)"}
exit status 1
In database.go:Connect(), configure Gorm to hook into our existing Logrus logger so:
we only log errors once
we log errors in either JSON or human-readable format depending on -json flag
If we provide the
-db
flag without postgres running, we get this outputIn
database.go:Connect()
, configure Gorm to hook into our existing Logrus logger so:-json
flaghttps://www.soberkoder.com/go-gorm-logging/
The text was updated successfully, but these errors were encountered: