# update: 2022-4-19 import logging import traceback import datetime LOG = logging.getLogger(__name__) # logging.basicConfig(format='%(levelname)s | %(asctime)s | %(module)s.%(funcName)s:%(lineno)s >>> %(message)s', # level=logging.DEBUG) logging.basicConfig(format=f"INFO: %(message)s", level=logging.INFO) def debug_log(tags, args, is_work=True, show_level=logging.INFO): """""" if not is_work: return elif type(args) == list: lines = f"{tags}:" for count, line in enumerate(args): lines += f"\n- {count + 1} - {line}" LOG.info(lines) elif type(args) == str: now_string = datetime.datetime.now().strftime('%Y-%m-%d-%H:%M:%S') LOG.info(f"{now_string}|{tags} | {args}") # LOG.info(f"{tags} | {args}") def trace_log(): """""" return traceback.format_exc()