diff --git a/docs/architecture/adr-001.md b/docs/architecture/adr-001.md index 4881adf9..a11a49e1 100644 --- a/docs/architecture/adr-001.md +++ b/docs/architecture/adr-001.md @@ -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: