Skip to content

Commit

Permalink
chore(logging): add version to error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Nov 20, 2024
1 parent 58108fc commit 308e4a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/pkg/commons/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

"github.com/gobitfly/beaconchain/pkg/commons/metrics"
"github.com/gobitfly/beaconchain/pkg/commons/version"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -70,6 +71,8 @@ func Debugf(format string, args ...interface{}) {
func logErrorInfo(err error, callerSkip int, isWarning bool, additionalInfos ...Fields) *logrus.Entry {
logFields := logrus.NewEntry(logrus.New())

logFields = logFields.WithField("_version", version.Version)

metricName := "unknown"
if err != nil {
metricName = err.Error()
Expand Down

0 comments on commit 308e4a3

Please sign in to comment.