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.

38 lines
887 B

10 years ago
10 years ago
  1. package main
  2. import (
  3. "os"
  4. "github.com/op/go-logging"
  5. "github.com/tendermint/tendermint/blocks"
  6. "github.com/tendermint/tendermint/consensus"
  7. "github.com/tendermint/tendermint/mempool"
  8. "github.com/tendermint/tendermint/p2p"
  9. "github.com/tendermint/tendermint/state"
  10. )
  11. var log = logging.MustGetLogger("main")
  12. func init() {
  13. // Customize the output format
  14. logging.SetFormatter(logging.MustStringFormatter("[%{level:.4s}] %{time:2006-01-02T15:04:05} %{shortfile:-20s} %{message}"))
  15. logBackend := logging.NewLogBackend(os.Stderr, "", 0)
  16. logBackend.Color = true
  17. logging.SetBackend(logBackend)
  18. // Test
  19. /*
  20. Log.Debug("debug")
  21. Log.Info("info")
  22. Log.Notice("notice")
  23. Log.Warning("warning")
  24. Log.Error("error")
  25. */
  26. blocks.SetBlocksLogger(log)
  27. consensus.SetConsensusLogger(log)
  28. mempool.SetMempoolLogger(log)
  29. p2p.SetP2PLogger(log)
  30. state.SetStateLogger(log)
  31. }