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.

30 lines
587 B

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