From b903e12d6bb6b21d2af3326a6a5e8f40d2854138 Mon Sep 17 00:00:00 2001 From: VaiTon Date: Sat, 25 Nov 2023 13:33:23 +0100 Subject: Print debug log before connecting to MongoDB --- caronte.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/caronte.go b/caronte.go index 95f00ef..da65e9b 100644 --- a/caronte.go +++ b/caronte.go @@ -20,6 +20,7 @@ package main import ( "flag" "fmt" + log "github.com/sirupsen/logrus" ) @@ -36,6 +37,7 @@ func main() { flag.Parse() logFields := log.Fields{"host": *mongoHost, "port": *mongoPort, "dbName": *dbName} + log.WithFields(logFields).Debug("connecting to MongoDB") storage, err := NewMongoStorage(*mongoHost, *mongoPort, *dbName) if err != nil { log.WithError(err).WithFields(logFields).Fatal("failed to connect to MongoDB") -- cgit v1.2.3-70-g09d2