aboutsummaryrefslogtreecommitdiffstats
path: root/mobile
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-23 22:49:05 +0800
committerGitHub <noreply@github.com>2017-02-23 22:49:05 +0800
commit357732a8404c9fe4d02f041d20a0d05381a3e6d1 (patch)
treeedaf8a63eb7f7434cd9b9cbd764b3c4c3d76191e /mobile
parent29fac7de448c85049a97cbec3dc0819122bd2cb0 (diff)
parentf89dd627760b43bd405cb3db1e5efdb100835db5 (diff)
downloaddexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.gz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.bz2
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.lz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.xz
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.tar.zst
dexon-357732a8404c9fe4d02f041d20a0d05381a3e6d1.zip
Merge pull request #3696 from karalabe/contextual-logger
Contextual logger
Diffstat (limited to 'mobile')
-rw-r--r--mobile/init.go7
-rw-r--r--mobile/logger.go6
2 files changed, 7 insertions, 6 deletions
diff --git a/mobile/init.go b/mobile/init.go
index 0fbc6bd3e..d7acc14ce 100644
--- a/mobile/init.go
+++ b/mobile/init.go
@@ -19,16 +19,15 @@
package geth
import (
+ "os"
"runtime"
- "github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/logger/glog"
+ "github.com/ethereum/go-ethereum/log"
)
func init() {
// Initialize the logger
- glog.SetV(logger.Info)
- glog.SetToStderr(true)
+ log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat())))
// Initialize the goroutine count
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/mobile/logger.go b/mobile/logger.go
index 97f80f9bb..9f24b3279 100644
--- a/mobile/logger.go
+++ b/mobile/logger.go
@@ -17,10 +17,12 @@
package geth
import (
- "github.com/ethereum/go-ethereum/logger/glog"
+ "os"
+
+ "github.com/ethereum/go-ethereum/log"
)
// SetVerbosity sets the global verbosity level (between 0 and 6 - see logger/verbosity.go).
func SetVerbosity(level int) {
- glog.SetV(level)
+ log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(level), log.StreamHandler(os.Stderr, log.TerminalFormat())))
}