Update CODE_STYLE.md

This commit is contained in:
Erik Johnston 2017-11-21 18:15:47 +00:00 committed by GitHub
parent ad23cb1024
commit 9f98522c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,8 +54,8 @@ issue number should be added to the comment, e.g. `// TODO(#324): ...`
## Logging
We prefer to log with static log messages and include any dynamic information
in fields.
We generally prefer to log with static log messages and include any dynamic
information in fields.
```golang
logger := util.GetLogger(ctx)
@ -70,6 +70,10 @@ logger.WithFields(logrus.Fields{
}).Info("Finished processing keys")
```
This is useful when logging to systems that natively understand log fields, as
it allows people to search and process the fields without having to parse the
log message.
## Visual Studio Code