mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 09:23:09 -06:00
Update CODE_STYLE.md
This commit is contained in:
parent
ad23cb1024
commit
9f98522c2c
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue