Skip to content

Commit

Permalink
Update logging style (2). Replaces #2801 (#2809)
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox authored May 19, 2017
1 parent 419c04b commit d509999
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ Please use the following example for when adding logs.
```python
# At the top of the module
import logging
logger = logging.getLogger(__name__)
from medusa.logger.adapters.style import BraceAdapter

log = BraceAdapter(logging.getLogger(__name__))
log.logger.addHandler(logging.NullHandler())

# For each log line
logger.info('{param1} {param2}', param1='nice', param2='catch')
log.info('{param1} {param2}', {'param1': 'nice', 'param2': 'catch'})
```
### String formatting
When you want to format a string and it's not for the purpose of a log message,
Expand Down

0 comments on commit d509999

Please sign in to comment.