cmd, core, eth, light, trie: add trie read caching layer

This commit is contained in:
Péter Szilágyi
2018-11-12 18:47:34 +02:00
parent 9a000601c6
commit 434dd5bc00
33 changed files with 1660 additions and 127 deletions

30
vendor/github.com/allegro/bigcache/logger.go generated vendored Normal file
View File

@ -0,0 +1,30 @@
package bigcache
import (
"log"
"os"
)
// Logger is invoked when `Config.Verbose=true`
type Logger interface {
Printf(format string, v ...interface{})
}
// this is a safeguard, breaking on compile time in case
// `log.Logger` does not adhere to our `Logger` interface.
// see https://golang.org/doc/faq#guarantee_satisfies_interface
var _ Logger = &log.Logger{}
// DefaultLogger returns a `Logger` implementation
// backed by stdlib's log
func DefaultLogger() *log.Logger {
return log.New(os.Stdout, "", log.LstdFlags)
}
func newLogger(custom Logger) Logger {
if custom != nil {
return custom
}
return DefaultLogger()
}