25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug.py 263 B

123456789101112131415
  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)