-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use services.Config.NewService/Engine (part 2) #14117
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ import ( | |
|
||
"github.com/smartcontractkit/chainlink-common/pkg/capabilities" | ||
"github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" | ||
"github.com/smartcontractkit/chainlink-common/pkg/logger" | ||
commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" | ||
"github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" | ||
"github.com/smartcontractkit/chainlink/v2/core/logger" | ||
) | ||
|
||
var ( | ||
|
@@ -56,15 +56,13 @@ func NewWriteTarget(lggr logger.Logger, id string, cr commontypes.ContractReader | |
"Write target.", | ||
) | ||
|
||
logger := lggr.Named("WriteTarget") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did the methods on the instance disappear? the new convention is less intuitive to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The common package logger interface captures only the simple methods implemented by zap. A Sugared logger can still be constructed from any instance to provide these operations as methods, but making one is messier than just calling the helper when there is just one thing to do. |
||
|
||
return &WriteTarget{ | ||
cr, | ||
cw, | ||
forwarderAddress, | ||
txGasLimit - FORWARDER_CONTRACT_LOGIC_GAS_COST, | ||
info, | ||
logger, | ||
logger.Named(lggr, "WriteTarget"), | ||
false, | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,9 @@ import ( | |
|
||
"github.com/smartcontractkit/chainlink-data-streams/llo" | ||
|
||
"github.com/smartcontractkit/chainlink-common/pkg/logger" | ||
"github.com/smartcontractkit/chainlink-common/pkg/services" | ||
llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo" | ||
|
||
"github.com/smartcontractkit/chainlink/v2/core/logger" | ||
) | ||
|
||
// A dummy transmitter useful for benchmarking and testing | ||
|
@@ -39,7 +38,7 @@ type transmitter struct { | |
|
||
func NewTransmitter(lggr logger.Logger, fromAccount string) Transmitter { | ||
return &transmitter{ | ||
lggr.Named("DummyTransmitter"), | ||
logger.Named(lggr, "DummyTransmitter"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why has this cascaded to so many places? i only see a handful of NewEngine calls in this PR. does this PR intermix disparate concerns - are all these logger chains strictly necessary in this specific change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I followed the compiler errors, so all are necessary, unless we have cases where unrelated things are in the same file I suppose - but that seems like a separate issue. |
||
fromAccount, | ||
} | ||
} | ||
|
@@ -66,7 +65,7 @@ func (t *transmitter) Transmit( | |
if err != nil { | ||
lggr.Debugw("Failed to decode JSON report", "err", err) | ||
} | ||
lggr = lggr.With( | ||
lggr = logger.With(lggr, | ||
"report.Report.ConfigDigest", r.ConfigDigest, | ||
"report.Report.SeqNr", r.SeqNr, | ||
"report.Report.ChannelID", r.ChannelID, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we delete this pkg entirely? confusing to have multiple ways to do the same thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it serves a different extended purpose, but it can be reduced later if we convert everything to use the simpler interface from common.