new logging

This commit is contained in:
Anton Kaliaev
2017-04-28 00:37:18 +04:00
parent 8d8e35ae53
commit 986bdd00a5
20 changed files with 141 additions and 102 deletions

View File

@ -2,11 +2,13 @@ package main
import (
"flag"
"log"
stdlog "log"
"os"
"github.com/tendermint/abci/server"
"github.com/tendermint/abci/types"
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"
)
func main() {
@ -18,8 +20,10 @@ func main() {
// Start the listener
srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication())
if err != nil {
log.Fatal(err.Error())
stdlog.Fatal(err.Error())
}
logger := log.NewTmLogger(os.Stdout)
srv.SetLogger(log.With(logger, "module", "abci-server"))
// Wait forever
cmn.TrapSignal(func() {