1234567891011121314151617181920212223242526 |
- # update: 2022-4-19
- import logging
- import traceback
- 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:
- LOG.info(f"{tags} | {args}")
- def trace_log():
- """"""
- return traceback.format_exc()
|