Skip to content

Commit

Permalink
Change logging library and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Djadih committed May 17, 2023
1 parent 749785f commit ae32e7d
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 1,986 deletions.
5 changes: 3 additions & 2 deletions eth/downloader/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import (
"errors"
"math/big"
"sort"
sync "github.com/sasha-s/go-deadlock"
"sync/atomic"
"time"

sync "github.com/sasha-s/go-deadlock"

"github.com/dominant-strategies/go-quai/common"
"github.com/dominant-strategies/go-quai/eth/protocols/eth"
"github.com/dominant-strategies/go-quai/event"
Expand Down Expand Up @@ -296,7 +297,7 @@ type peerSet struct {
func newPeerSet() *peerSet {
return &peerSet{
peers: make(map[string]*peerConnection),
rates: msgrate.NewTrackers(log.Log),
rates: msgrate.NewTrackers(&log.Log),
}
}

Expand Down
6 changes: 2 additions & 4 deletions ethdb/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,12 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
// The customize function allows the caller to modify the leveldb options.
func NewCustom(file string, namespace string, customize func(options *opt.Options)) (*Database, error) {
options := configureOptions(customize)
logger := log.Log
usedCache := options.GetBlockCacheCapacity() + options.GetWriteBuffer()*2
logCtx := []interface{}{"cache", common.StorageSize(usedCache), "handles", options.GetOpenFilesCacheCapacity()}
if options.ReadOnly {
logCtx = append(logCtx, "readonly", "true")
}
logger.Info("Allocated cache and file handles")
logger.Info(logCtx...)
log.Info("Allocated cache and file handles", logCtx...)

// Open the db and recover any potential corruptions
db, err := leveldb.OpenFile(file, options)
Expand All @@ -129,7 +127,7 @@ func NewCustom(file string, namespace string, customize func(options *opt.Option
ldb := &Database{
fn: file,
db: db,
log: logger,
log: log.Log,
quitChan: make(chan chan error),
}
ldb.compTimeMeter = metrics.NewRegisteredMeter(namespace+"compact/time", nil)
Expand Down
11 changes: 0 additions & 11 deletions log/CONTRIBUTORS

This file was deleted.

13 changes: 0 additions & 13 deletions log/LICENSE

This file was deleted.

77 changes: 0 additions & 77 deletions log/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions log/README_ETHEREUM.md

This file was deleted.

Loading

0 comments on commit ae32e7d

Please sign in to comment.