diff options
author | rsiddharth <s@ricketyspace.net> | 2017-03-20 00:53:55 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2017-03-20 00:53:55 +0000 |
commit | 9b7dfcb956137ed085e6433180dcd6a24d662b2b (patch) | |
tree | 729f6fdcf465e1d263a25e4d2977f98fccdc166d | |
parent | 214625056dc8f7723f5a018c3000c3e01c8be7fa (diff) |
markdown_link_style: Update `MDLSLogger`.
Add console handler (logging.StreamHandler) to logger.
* markdown_link_style/logging.py (MDLSLogger.__init__): Update method.
-rw-r--r-- | markdown_link_style/logging.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/markdown_link_style/logging.py b/markdown_link_style/logging.py index 3707cab..2a93d7b 100644 --- a/markdown_link_style/logging.py +++ b/markdown_link_style/logging.py @@ -19,15 +19,23 @@ # <http://www.gnu.org/licenses/>. import logging +import sys class MDLSLogger(object): """Logging utility for modules in markdown-link-style. """ - def __init__(self, name): + def __init__(self, name, stream=sys.stdout): self.logger = logging.getLogger(name) + # Console handler. + sh = logging.StreamHandler(stream) + sh.setLevel(logging.DEBUG) + + # Add handler to logger. + self.logger.addHandler(sh) + def debug(self, msg, *args, **kwargs): self.logger.debug(msg, *args, **kwargs) |