Skip to content

Commit 69b75ac

Browse files
committed
Use general logger rather than local declared one
1 parent bc9d5e4 commit 69b75ac

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

internal/device/inband/inband.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/metal-toolbox/ironlib/actions"
99
"github.com/sirupsen/logrus"
1010

11-
"github.com/metal-toolbox/alloy/internal/app"
1211
"github.com/metal-toolbox/alloy/internal/model"
1312
)
1413

@@ -21,13 +20,8 @@ type Queryor struct {
2120

2221
// New returns an inband inventory collector
2322
func NewQueryor(logger *logrus.Logger) *Queryor {
24-
loggerEntry := app.NewLogrusEntryFromLogger(
25-
logrus.Fields{"component": "queryor.inband"},
26-
logger,
27-
)
28-
2923
return &Queryor{
30-
logger: loggerEntry,
24+
logger: logger.WithFields(logrus.Fields{"component": "queryor.inband"}),
3125
}
3226
}
3327

internal/device/outofband/outofband.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"go.opentelemetry.io/otel/codes"
1919
"go.opentelemetry.io/otel/trace"
2020

21-
"github.com/metal-toolbox/alloy/internal/app"
2221
"github.com/metal-toolbox/alloy/internal/metrics"
2322
"github.com/metal-toolbox/alloy/internal/model"
2423
)
@@ -64,18 +63,13 @@ type BMCQueryor interface {
6463

6564
// NewQueryor returns a instance of the Queryor inventory collector
6665
func NewQueryor(logger *logrus.Logger) *Queryor {
67-
loggerEntry := app.NewLogrusEntryFromLogger(
68-
logrus.Fields{"component": "collector.outofband"},
69-
logger,
70-
)
71-
7266
lt, err := time.ParseDuration(logoutTimeout)
7367
if err != nil {
7468
panic(err)
7569
}
7670

7771
c := &Queryor{
78-
logger: loggerEntry,
72+
logger: logger.WithFields(logrus.Fields{"component": "collector.outofband"}),
7973
logoutTimeout: lt,
8074
}
8175

0 commit comments

Comments
 (0)