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
684 B

11 years ago
  1. package main
  2. import (
  3. "github.com/cihub/seelog"
  4. "github.com/tendermint/tendermint/p2p"
  5. )
  6. var log seelog.LoggerInterface
  7. func init() {
  8. // TODO: replace with configuration file in the ~/.tendermint directory.
  9. config := `
  10. <seelog type="sync" minlevel="debug">
  11. <outputs formatid="colored">
  12. <console/>
  13. </outputs>
  14. <formats>
  15. <format id="main" format="%Date/%Time [%LEV] %Msg%n"/>
  16. <format id="colored" format="%Time %EscM(46)%Level%EscM(49) %EscM(36)%File%EscM(39) %Msg%n%EscM(0)"/>
  17. </formats>
  18. </seelog>`
  19. var err error
  20. log, err = seelog.LoggerFromConfigAsBytes([]byte(config))
  21. if err != nil {
  22. panic(err)
  23. }
  24. p2p.SetLogger(log)
  25. }