Guest User

Untitled

a guest
Jun 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import logging
  2. import logging.handlers
  3.  
  4. log = logging.getLogger(__name__)
  5. log.setLevel(logging.DEBUG)
  6. handler = logging.handlers.SysLogHandler(address = '/dev/log')
  7. formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s')
  8. handler.setFormatter(formatter)
  9.  
  10. log.addHandler(handler)
  11.  
  12. log.debug('this is debug')
  13. log.critical('this is critical')
Add Comment
Please, Sign In to add comment