Skip to content

Commit

Permalink
add err_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelliao committed May 18, 2015
1 parent 706eee9 commit b3b303e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions samples/debug/err_logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# err_logging.py

import logging

def foo(s):
return 10 / int(s)

def bar(s):
return foo(s) * 2

def main():
try:
bar('0')
except Exception as e:
logging.exception(e)

main()
print('END')

0 comments on commit b3b303e

Please sign in to comment.