markdown-link-style

switch between inline and footnote link style in markdown documents.
git clone git://git.ricketyspace.net/markdown-link-style.git
Log | Files | Refs

commit 9b7dfcb956137ed085e6433180dcd6a24d662b2b
parent 214625056dc8f7723f5a018c3000c3e01c8be7fa
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon, 20 Mar 2017 00:53:55 +0000

markdown_link_style: Update `MDLSLogger`.

Add console handler (logging.StreamHandler) to logger.

* markdown_link_style/logging.py (MDLSLogger.__init__): Update method.

Diffstat:
markdown_link_style/logging.py | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 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)