update arch proposal [ci skip] [circleci skip]

This commit is contained in:
Anton Kaliaev 2017-05-12 20:32:10 +02:00
parent 556fbf0c4c
commit 538b325150
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
1 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,8 @@ type Logger interface {
Debug(msg string, keyvals ...interface{}) error
Info(msg string, keyvals ...interface{}) error
Error(msg string, keyvals ...interface{}) error
With(keyvals ...interface{}) Logger
}
```
@ -53,13 +55,13 @@ Many people say that they like the current output, so let's stick with it.
NOTE[04-25|14:45:08] ABCI Replay Blocks module=consensus appHeight=0 storeHeight=0 stateHeight=0
```
One minor change:
Couple of minor changes:
```
NOTE[04-25|14:45:08][consensus] ABCI Replay Blocks appHeight=0 storeHeight=0 stateHeight=0
I[04-25|14:45:08.322] ABCI Replay Blocks module=consensus appHeight=0 storeHeight=0 stateHeight=0
```
I think it makes sense to move `module` to the beginning because every message has it.
Notice the level is encoded using only one char plus milliseconds.
Note: there are many other formats out there like [logfmt](https://brandur.org/logfmt).
@ -153,14 +155,14 @@ Important keyvals should go first. Example:
```
correct
NOTE[04-25|14:45:08][consensus] ABCI Replay Blocks instance=1 appHeight=0 storeHeight=0 stateHeight=0
I[04-25|14:45:08.322] ABCI Replay Blocks module=consensus instance=1 appHeight=0 storeHeight=0 stateHeight=0
```
not
```
wrong
NOTE[04-25|14:45:08][consensus] ABCI Replay Blocks appHeight=0 storeHeight=0 stateHeight=0 instance=1
I[04-25|14:45:08.322] ABCI Replay Blocks module=consensus appHeight=0 storeHeight=0 stateHeight=0 instance=1
```
for that in most cases you'll need to add `instance` field to a logger upon creating, not when u log a particular message: