Skip to content

Commit

Permalink
logger cleanup (#731)
Browse files Browse the repository at this point in the history
* bump unrecognized simulation to error level

* remove deprecated logger
  • Loading branch information
aalu1418 authored May 31, 2024
1 parent 17ffc78 commit 0208c67
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
3 changes: 2 additions & 1 deletion pkg/solana/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
"github.com/gagliardetto/solana-go/rpc"
"golang.org/x/sync/singleflight"

"github.com/smartcontractkit/chainlink-common/pkg/logger"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"
)

const (
Expand Down
6 changes: 0 additions & 6 deletions pkg/solana/logger/logger.go

This file was deleted.

7 changes: 3 additions & 4 deletions pkg/solana/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import (
"github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median"
"github.com/smartcontractkit/libocr/offchainreporting2/types"

relaylogger "github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
relaytypes "github.com/smartcontractkit/chainlink-common/pkg/types"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/txm"
)

Expand Down Expand Up @@ -99,7 +98,7 @@ func (r *Relayer) NewContractReader(_ []byte) (relaytypes.ContractReader, error)
func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error) {
ctx, cancel := r.stopCh.NewCtx()
defer cancel()
lggr := relaylogger.Named(r.lggr, "MedianProvider")
lggr := logger.Named(r.lggr, "MedianProvider")
configWatcher, err := newConfigProvider(ctx, lggr, r.chain, rargs)
if err != nil {
return nil, err
Expand Down Expand Up @@ -168,7 +167,7 @@ type configProvider struct {
}

func newConfigProvider(ctx context.Context, lggr logger.Logger, chain Chain, args relaytypes.RelayArgs) (*configProvider, error) {
lggr = relaylogger.Named(lggr, "ConfigProvider")
lggr = logger.Named(lggr, "ConfigProvider")
var relayConfig RelayConfig
err := json.Unmarshal(args.RelayConfig, &relayConfig)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/state_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/utils"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/transmissions_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/utils"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"
)

type TransmissionsCache struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/smartcontractkit/libocr/offchainreporting2/types"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/utils"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"
)

var _ types.ContractTransmitter = (*Transmitter)(nil)
Expand Down
7 changes: 3 additions & 4 deletions pkg/solana/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import (
"github.com/gagliardetto/solana-go/rpc"
"github.com/google/uuid"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
relayutils "github.com/smartcontractkit/chainlink-common/pkg/utils"

solanaClient "github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/fees"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/logger"

relayutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
)

const (
Expand Down Expand Up @@ -492,7 +491,7 @@ func (txm *Txm) simulate(ctx context.Context) {
// unrecognized errors (indicates more concerning failures)
default:
txm.txs.OnError(msg.signature, TxFailSimOther) // cancel retry
txm.lggr.Warnw("simulate: unrecognized error", "id", msg.id, "signature", msg.signature, "result", res)
txm.lggr.Errorw("simulate: unrecognized error", "id", msg.id, "signature", msg.signature, "result", res)
continue
}
}
Expand Down

0 comments on commit 0208c67

Please sign in to comment.