Skip to content

Commit a69cacb

Browse files
committed
Updated version of ipfs/go-log to v2
Updated version of ipfs/go-log to the latest v2.
1 parent f22b8e7 commit a69cacb

File tree

10 files changed

+43
-52
lines changed

10 files changed

+43
-52
lines changed

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/gorilla/websocket v1.4.1 // indirect
1919
github.com/hashicorp/golang-lru v0.5.3 // indirect
2020
github.com/huin/goupnp v1.0.0 // indirect
21-
github.com/ipfs/go-log v0.0.1
21+
github.com/ipfs/go-log/v2 v2.0.4
2222
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
2323
github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 // indirect
2424
github.com/olekukonko/tablewriter v0.0.2 // indirect
@@ -29,8 +29,9 @@ require (
2929
github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0 // indirect
3030
github.com/tyler-smith/go-bip39 v1.0.2 // indirect
3131
github.com/urfave/cli v1.22.1
32+
go.uber.org/zap v1.14.1 // indirect
3233
golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794
3334
golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 // indirect
34-
golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93
35+
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5
3536
gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff // indirect
3637
)

go.sum

Lines changed: 27 additions & 37 deletions
Large diffs are not rendered by default.

pkg/chain/ethereum/blockcounter/blockcounter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"sync"
88
"time"
99

10-
"github.com/ipfs/go-log"
10+
"github.com/ipfs/go-log/v2"
1111

1212
"github.com/ethereum/go-ethereum/core/types"
1313
"github.com/ethereum/go-ethereum/ethclient"
@@ -173,7 +173,7 @@ func (ebc *EthereumBlockCounter) subscribeBlocks(ctx context.Context, client *et
173173
newBlockChan,
174174
)
175175
if err != nil {
176-
logger.Warningf("could not create subscription to new blocks: [%v]", err)
176+
logger.Warnf("could not create subscription to new blocks: [%v]", err)
177177
errorChan <- err
178178
return
179179
}
@@ -183,7 +183,7 @@ func (ebc *EthereumBlockCounter) subscribeBlocks(ctx context.Context, client *et
183183
case header := <-newBlockChan:
184184
ebc.subscriptionChannel <- block{header.Number.String()}
185185
case err = <-subscription.Err():
186-
logger.Warningf("subscription to new blocks interrupted: [%v]", err)
186+
logger.Warnf("subscription to new blocks interrupted: [%v]", err)
187187
subscription.Unsubscribe()
188188
errorChan <- err
189189
return

pkg/chain/ethereum/ethutil/ethutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"io/ioutil"
99
"math/big"
1010

11-
"github.com/ipfs/go-log"
11+
"github.com/ipfs/go-log/v2"
1212

1313
"github.com/ethereum/go-ethereum"
1414
"github.com/ethereum/go-ethereum/accounts/abi"
@@ -141,7 +141,7 @@ func CallAtBlock(
141141
// the true gas limit requirement as other transactions may be added or removed by miners,
142142
// but it should provide a basis for setting a reasonable default.
143143
func EstimateGas(
144-
from common.Address,
144+
from common.Address,
145145
to common.Address,
146146
method string,
147147
contractABI *abi.ABI,

pkg/logging/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
logging "github.com/ipfs/go-log"
7+
logging "github.com/ipfs/go-log/v2"
88
)
99

1010
// Configure sets up logging configuration from the given string. This string is

pkg/persistence/persistence.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Package persistence adds a layer which handles data storage. This package
2-
// separates the data from the business layer and is responsible for saving and
2+
// separates the data from the business layer and is responsible for saving and
33
// retrieving it.
44
package persistence
55

6-
import "github.com/ipfs/go-log"
6+
import "github.com/ipfs/go-log/v2"
77

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

tools/generators/ethereum/contract.go.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/ethereum/go-ethereum/common"
1515
"github.com/ethereum/go-ethereum/core/types"
1616

17-
"github.com/ipfs/go-log"
17+
"github.com/ipfs/go-log/v2"
1818

1919
"github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil"
2020
"github.com/keep-network/keep-common/pkg/subscription"

tools/generators/ethereum/contract_events.go.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) Watch{{$event.CapsName}}(
4848
for {
4949
select {
5050
case <-errorChan:
51-
{{$logger}}.Warning(
51+
{{$logger}}.Warn(
5252
"subscription to event {{$event.CapsName}} terminated with error; " +
5353
"resubscription attempt will be performed after the retry delay",
5454
)
@@ -123,4 +123,4 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) subscribe{{$event.CapsName}}(
123123
return subscription.NewEventSubscription(unsubscribeCallback), nil
124124
}
125125

126-
{{- end -}}
126+
{{- end -}}

tools/generators/ethereum/contract_events_template_content.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func ({{$contract.ShortVar}} *{{$contract.Class}}) Watch{{$event.CapsName}}(
5151
for {
5252
select {
5353
case <-errorChan:
54-
{{$logger}}.Warning(
54+
{{$logger}}.Warn(
5555
"subscription to event {{$event.CapsName}} terminated with error; " +
5656
"resubscription attempt will be performed after the retry delay",
5757
)

tools/generators/ethereum/contract_template_content.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/ethereum/go-ethereum/common"
1818
"github.com/ethereum/go-ethereum/core/types"
1919
20-
"github.com/ipfs/go-log"
20+
"github.com/ipfs/go-log/v2"
2121
2222
"github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil"
2323
"github.com/keep-network/keep-common/pkg/subscription"

0 commit comments

Comments
 (0)