aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/markdown_py6
-rw-r--r--markdown/commandline.py6
2 files changed, 2 insertions, 10 deletions
diff --git a/bin/markdown_py b/bin/markdown_py
index b34cb66..111b2c1 100755
--- a/bin/markdown_py
+++ b/bin/markdown_py
@@ -29,13 +29,7 @@ Copyright 2004 Manfred Stienstra (the original version)
License: BSD (see docs/LICENSE for details).
"""
-import logging
from markdown import commandline
-# Setup a logger manually for compatibility with Python 2.3
-logger = logging.getLogger('MARKDOWN')
-logger.setLevel(commandline.COMMAND_LINE_LOGGING_LEVEL)
-logger.addHandler(logging.StreamHandler())
-
if __name__ == '__main__':
commandline.run()
diff --git a/markdown/commandline.py b/markdown/commandline.py
index caf9288..e2ef264 100644
--- a/markdown/commandline.py
+++ b/markdown/commandline.py
@@ -13,9 +13,6 @@ from logging import DEBUG, INFO, CRITICAL
logger = logging.getLogger('MARKDOWN')
-# default logging level for command-line use
-COMMAND_LINE_LOGGING_LEVEL = CRITICAL
-
def parse_options():
"""
Define and parse `optparse` options for command-line usage.
@@ -77,7 +74,8 @@ def run():
# Parse options and adjust logging level if necessary
options, logging_level = parse_options()
if not options: sys.exit(2)
- if logging_level: logger.setLevel(logging_level)
+ logger.setLevel(logging_level)
+ logger.addHandler(logging.StreamHandler())
# Run
markdown.markdownFromFile(**options)