log.py 389 B

1234567891011121314151617181920212223
  1. import logging
  2. __all__ = ['debug', 'log']
  3. # Configure the logger
  4. logging.basicConfig(
  5. format='[%(asctime)s] %(message)s',
  6. level=logging.INFO
  7. )
  8. def log(task, fmt, *args):
  9. '''Log a standard message
  10. '''
  11. logging.info('%-8s ' + fmt, task, *args)
  12. def debug(task, fmt, *args):
  13. '''Report some debug information
  14. '''
  15. logging.debug('%-8s ' + fmt, task, *args)