Add human-readbale log output (#681)

Add human-readable log output. It prints out the exact source code line information.
This commit is contained in:
Zoltan Papp
2023-02-27 12:20:07 +01:00
committed by GitHub
parent b52afe8d42
commit 9f951c8fb5
6 changed files with 194 additions and 21 deletions
+10
View File
@@ -0,0 +1,10 @@
package formatter
import "github.com/sirupsen/logrus"
// SetTextFormatter set the formatter for given logger.
func SetTextFormatter(logger *logrus.Logger) {
logger.Formatter = NewTextFormatter()
logger.ReportCaller = true
logger.AddHook(NewContextHook())
}