Commit d7b5566b authored by Matthieu Boileau's avatar Matthieu Boileau

Use logging.getLogger(__name__)

parent fbb517aa
......@@ -24,6 +24,19 @@ SPIPFILES = "spip_auteurs.yml", \
"spip_rubriques.yml"
OUTPUTDIR = "spip_yml"
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create console handler with higher log level and colored output
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
LOGFORMAT = "%(log_color)s%(message)s%(reset)s"
color_formatter = ColoredFormatter(LOGFORMAT)
ch.setFormatter(color_formatter)
# add the handlers to logger
logger.addHandler(ch)
def strip_invalid(s):
"""
......@@ -155,19 +168,6 @@ def parse_cl_args():
if __name__ == '__main__':
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# create console handler with higher log level and colored output
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
LOGFORMAT = "%(log_color)s%(message)s%(reset)s"
color_formatter = ColoredFormatter(LOGFORMAT)
ch.setFormatter(color_formatter)
# add the handlers to logger
logger.addHandler(ch)
args = parse_cl_args()
reset_output_directory()
split_yaml(args.spipfile)
......
......@@ -25,7 +25,7 @@ SKIP_REASON = {"skip_rub": "belonging to a skipped rubrique",
"unpub": "not published"}
SHORTEN = {'article': 'art', 'rubrique': 'rub', 'breve': 'brev', 'message': 'mess'}
logger = logging.getLogger()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# create file handler which logs up to info messages
......
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