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

  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/p2p"
  8. )
  9. var log = logging.MustGetLogger("main")
  10. func init() {
  11. // Customize the output format
  12. logging.SetFormatter(logging.MustStringFormatter("[%{level:.4s}] %{time:2006-01-02T15:04:05} %{shortfile:-20s} %{message}"))
  13. logBackend := logging.NewLogBackend(os.Stderr, "", 0)
  14. logBackend.Color = true
  15. logging.SetBackend(logBackend)
  16. // Test
  17. /*
  18. Log.Debug("debug")
  19. Log.Info("info")
  20. Log.Notice("notice")
  21. Log.Warning("warning")
  22. Log.Error("error")
  23. */
  24. p2p.SetP2PLogger(log)
  25. blocks.SetBlocksLogger(log)
  26. consensus.SetConsensusLogger(log)
  27. }