You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
743 B

package main
import (
"os"
"github.com/op/go-logging"
"github.com/tendermint/tendermint/blocks"
"github.com/tendermint/tendermint/consensus"
"github.com/tendermint/tendermint/p2p"
)
var log = logging.MustGetLogger("main")
func init() {
// Customize the output format
logging.SetFormatter(logging.MustStringFormatter("[%{level:.4s}] %{time:2006-01-02T15:04:05} %{shortfile:-20s} %{message}"))
logBackend := logging.NewLogBackend(os.Stderr, "", 0)
logBackend.Color = true
logging.SetBackend(logBackend)
// Test
/*
Log.Debug("debug")
Log.Info("info")
Log.Notice("notice")
Log.Warning("warning")
Log.Error("error")
*/
p2p.SetP2PLogger(log)
blocks.SetBlocksLogger(log)
consensus.SetConsensusLogger(log)
}