Commit fd9694da authored by Pietro Saccardi's avatar Pietro Saccardi

Allowing custom options in logging setup.

parent 49b0902a
......@@ -2,13 +2,13 @@ import logging
import re
def ensure_logging_setup(level=logging.INFO, reset=False):
def ensure_logging_setup(level=logging.INFO, reset=False, **kwargs):
if reset:
# Remove all handlers associated with the root logger object.
# https://stackoverflow.com/a/12158233/1749822
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=level)
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=level, **kwargs)
_RGX_FIRST_CAP = re.compile('(.)([A-Z][a-z]+)')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment