Skip to content
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

Upgraded version of ipfs/go-log to v2 #30

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/gorilla/websocket v1.4.1 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/huin/goupnp v1.0.0 // indirect
github.com/ipfs/go-log v0.0.1
github.com/ipfs/go-log/v2 v2.0.4
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 // indirect
github.com/olekukonko/tablewriter v0.0.2 // indirect
Expand All @@ -29,8 +29,9 @@ require (
github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0 // indirect
github.com/tyler-smith/go-bip39 v1.0.2 // indirect
github.com/urfave/cli v1.22.1
go.uber.org/zap v1.14.1 // indirect
golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794
golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 // indirect
golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff // indirect
)
64 changes: 27 additions & 37 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/chain/ethereum/blockcounter/blockcounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/ipfs/go-log"
"github.com/ipfs/go-log/v2"

"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
Expand Down Expand Up @@ -173,7 +173,7 @@ func (ebc *EthereumBlockCounter) subscribeBlocks(ctx context.Context, client *et
newBlockChan,
)
if err != nil {
logger.Warningf("could not create subscription to new blocks: [%v]", err)
logger.Warnf("could not create subscription to new blocks: [%v]", err)
errorChan <- err
return
}
Expand All @@ -183,7 +183,7 @@ func (ebc *EthereumBlockCounter) subscribeBlocks(ctx context.Context, client *et
case header := <-newBlockChan:
ebc.subscriptionChannel <- block{header.Number.String()}
case err = <-subscription.Err():
logger.Warningf("subscription to new blocks interrupted: [%v]", err)
logger.Warnf("subscription to new blocks interrupted: [%v]", err)
subscription.Unsubscribe()
errorChan <- err
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/chain/ethereum/ethutil/ethutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io/ioutil"
"math/big"

"github.com/ipfs/go-log"
"github.com/ipfs/go-log/v2"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
Expand Down Expand Up @@ -141,7 +141,7 @@ func CallAtBlock(
// the true gas limit requirement as other transactions may be added or removed by miners,
// but it should provide a basis for setting a reasonable default.
func EstimateGas(
from common.Address,
from common.Address,
to common.Address,
method string,
contractABI *abi.ABI,
Expand Down
2 changes: 1 addition & 1 deletion pkg/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

logging "github.com/ipfs/go-log"
logging "github.com/ipfs/go-log/v2"
)

// Configure sets up logging configuration from the given string. This string is
Expand Down
4 changes: 2 additions & 2 deletions pkg/persistence/persistence.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Package persistence adds a layer which handles data storage. This package
// separates the data from the business layer and is responsible for saving and
// separates the data from the business layer and is responsible for saving and
// retrieving it.
package persistence

import "github.com/ipfs/go-log"
import "github.com/ipfs/go-log/v2"

var logger = log.Logger("keep-persistence")

Expand Down
2 changes: 1 addition & 1 deletion tools/generators/ethereum/contract.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"

"github.com/ipfs/go-log"
"github.com/ipfs/go-log/v2"

"github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil"
"github.com/keep-network/keep-common/pkg/subscription"
Expand Down
4 changes: 2 additions & 2 deletions tools/generators/ethereum/contract_events.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) Watch{{$event.CapsName}}(
for {
select {
case <-errorChan:
{{$logger}}.Warning(
{{$logger}}.Warn(
"subscription to event {{$event.CapsName}} terminated with error; " +
"resubscription attempt will be performed after the retry delay",
)
Expand Down Expand Up @@ -123,4 +123,4 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) subscribe{{$event.CapsName}}(
return subscription.NewEventSubscription(unsubscribeCallback), nil
}

{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) Watch{{$event.CapsName}}(
for {
select {
case <-errorChan:
{{$logger}}.Warning(
{{$logger}}.Warn(
"subscription to event {{$event.CapsName}} terminated with error; " +
"resubscription attempt will be performed after the retry delay",
)
Expand Down
2 changes: 1 addition & 1 deletion tools/generators/ethereum/contract_template_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"

"github.com/ipfs/go-log"
"github.com/ipfs/go-log/v2"

"github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil"
"github.com/keep-network/keep-common/pkg/subscription"
Expand Down