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.

32 lines
651 B

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