mirror of
https://github.com/tendermint/tendermint.git
synced 2026-05-31 11:26:20 +00:00
libs/log: text logging format changes (#6589)
This commit is contained in:
@@ -32,7 +32,7 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi
|
||||
- P2P Protocol
|
||||
|
||||
- Go API
|
||||
- [logging] \#6534 Removed the existing custom Tendermint logger backed by go-kit. The logging interface, `Logger`, remains.
|
||||
- [libs/log] \#6534 Removed the existing custom Tendermint logger backed by go-kit. The logging interface, `Logger`, remains.
|
||||
Tendermint still provides a default logger backed by the performant zerolog logger. (@alexanderbez)
|
||||
- [mempool] \#6529 The `Context` field has been removed from the `TxInfo` type. `CheckTx` now requires a `Context` argument. (@alexanderbez)
|
||||
- [abci/client, proxy] \#5673 `Async` funcs return an error, `Sync` and `Async` funcs accept `context.Context` (@melekes)
|
||||
@@ -87,7 +87,7 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi
|
||||
- [config/indexer] \#6411 Introduce support for custom event indexing data sources, specifically PostgreSQL. (@JayT106)
|
||||
|
||||
### IMPROVEMENTS
|
||||
|
||||
- [libs/log] Console log formatting changes as a result of \#6534 and \#6589. (@tychoish)
|
||||
- [statesync] \#6566 Allow state sync fetchers and request timeout to be configurable. (@alexanderbez)
|
||||
- [types] \#6478 Add `block_id` to `newblock` event (@jeebster)
|
||||
- [crypto/ed25519] \#5632 Adopt zip215 `ed25519` verification. (@marbar3778)
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
@@ -29,7 +30,17 @@ func NewDefaultLogger(format, level string, trace bool) (Logger, error) {
|
||||
var logWriter io.Writer
|
||||
switch strings.ToLower(format) {
|
||||
case LogFormatPlain, LogFormatText:
|
||||
logWriter = zerolog.ConsoleWriter{Out: os.Stderr}
|
||||
logWriter = zerolog.ConsoleWriter{
|
||||
Out: os.Stderr,
|
||||
NoColor: true,
|
||||
TimeFormat: time.RFC3339,
|
||||
FormatLevel: func(i interface{}) string {
|
||||
if ll, ok := i.(string); ok {
|
||||
return strings.ToUpper(ll)
|
||||
}
|
||||
return "????"
|
||||
},
|
||||
}
|
||||
|
||||
case LogFormatJSON:
|
||||
logWriter = os.Stderr
|
||||
|
||||
Reference in New Issue
Block a user