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

@ -1,33 +1,35 @@
package main
import (
"fmt"
"log"
"os"
"strconv"
"strings"
"testing"
"github.com/tendermint/abci/client"
abcicli "github.com/tendermint/abci/client"
"github.com/tendermint/abci/server"
"github.com/tendermint/abci/types"
"github.com/tendermint/tmlibs/log"
)
func TestChainAware(t *testing.T) {
app := NewChainAwareApplication()
logger := log.NewTmLogger(os.Stdout)
// Start the listener
srv, err := server.NewServer("unix://test.sock", "socket", app)
if err != nil {
t.Fatal(err)
}
srv.SetLogger(log.With(logger, "module", "abci-server"))
defer srv.Stop()
// Connect to the socket
client, err := abcicli.NewSocketClient("unix://test.sock", false)
if err != nil {
log.Fatal(fmt.Sprintf("Error starting socket client: %v", err.Error()))
t.Fatalf("Error starting socket client: %v", err.Error())
}
client.SetLogger(log.With(logger, "module", "abci-client"))
client.Start()
defer client.Stop()