diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cd9150f9..72eb6866d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.8.2 +*Dec 10th, 2018* + +BUG FIXES + +- [log] Add json log format + ## 0.8.1 *Dec 10th, 2018* diff --git a/docker-compose.yml b/docker-compose.yml index 1ec30d42e..e54980549 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.4" services: minter: - image: minterteam/minter:0.8.1 + image: minterteam/minter:0.8.2 volumes: - ~/.minter:/minter ports: diff --git a/log/log.go b/log/log.go index 35f2ebdc5..e2cfdbef3 100644 --- a/log/log.go +++ b/log/log.go @@ -4,6 +4,7 @@ import ( "github.com/MinterTeam/minter-go-node/config" "github.com/tendermint/tendermint/libs/cli/flags" "github.com/tendermint/tendermint/libs/log" + "io" "os" ) @@ -13,7 +14,7 @@ var ( ) func init() { - var l log.Logger + var dest io.Writer = os.Stdout if cfg.LogPath != "stdout" { file, err := os.OpenFile(cfg.LogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) @@ -22,9 +23,18 @@ func init() { panic(err) } - l = log.NewTMLogger(file) - } else { - l = log.NewTMLogger(os.Stdout) + dest = file + } + + var l log.Logger + + switch cfg.LogFormat { + case config.LogFormatJSON: + l = log.NewTMJSONLogger(dest) + case config.LogFormatPlain: + l = log.NewTMLogger(dest) + default: + panic("unsupported log format") } l, err := flags.ParseLogLevel(cfg.LogLevel, l, "info") diff --git a/version/version.go b/version/version.go index 98fb1cc07..2854f0c19 100755 --- a/version/version.go +++ b/version/version.go @@ -4,12 +4,12 @@ package version const ( Maj = "0" Min = "8" - Fix = "1" + Fix = "2" ) var ( // Must be a string because scripts like dist.sh read this file. - Version = "0.8.1" + Version = "0.8.2" // GitCommit is the current HEAD set using ldflags. GitCommit string