You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 rivejä
263 B

  1. #!/usr/bin/env python3
  2. from traceback import print_exc
  3. show_debug_messages = False
  4. def debug_print(what):
  5. if not show_debug_messages:
  6. return
  7. if isinstance(what, Exception):
  8. print_exc(what)
  9. else:
  10. print("[DEBUG] %s" % what)