X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/44c95f99098fa6c6acbfa82d4b6cbc6015eb6e39..HEAD:/services/ws/event.go diff --git a/services/ws/event.go b/services/ws/event.go index 0e414a33aa..8b6a2e81bb 100644 --- a/services/ws/event.go +++ b/services/ws/event.go @@ -2,15 +2,16 @@ // // SPDX-License-Identifier: AGPL-3.0 -package main +package ws import ( "database/sql" "sync" "time" - "git.curoverse.com/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvados" "github.com/ghodss/yaml" + "github.com/sirupsen/logrus" ) type eventSink interface { @@ -25,12 +26,13 @@ type eventSource interface { } type event struct { - LogID uint64 + LogID int64 Received time.Time Ready time.Time Serial uint64 db *sql.DB + logger logrus.FieldLogger logRow *arvados.Log err error mtx sync.Mutex @@ -57,12 +59,12 @@ func (e *event) Detail() *arvados.Log { &logRow.CreatedAt, &propYAML) if e.err != nil { - logger(nil).WithField("LogID", e.LogID).WithError(e.err).Error("QueryRow failed") + e.logger.WithField("LogID", e.LogID).WithError(e.err).Error("QueryRow failed") return nil } e.err = yaml.Unmarshal(propYAML, &logRow.Properties) if e.err != nil { - logger(nil).WithField("LogID", e.LogID).WithError(e.err).Error("yaml decode failed") + e.logger.WithField("LogID", e.LogID).WithError(e.err).Error("yaml decode failed") return nil } e.logRow = &logRow