From d509999019b11aec234b9127bddad71bfb7588b9 Mon Sep 17 00:00:00 2001 From: Dario Date: Fri, 19 May 2017 13:31:56 +0200 Subject: [PATCH] Update logging style (2). Replaces #2801 (#2809) --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aed73cee2b..1a672c4cba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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,