Skip to content

Commit b3b303e

Browse files
committed
add err_logging
1 parent 706eee9 commit b3b303e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

samples/debug/err_logging.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# err_logging.py
2+
3+
import logging
4+
5+
def foo(s):
6+
return 10 / int(s)
7+
8+
def bar(s):
9+
return foo(s) * 2
10+
11+
def main():
12+
try:
13+
bar('0')
14+
except Exception as e:
15+
logging.exception(e)
16+
17+
main()
18+
print('END')
19+

0 commit comments

Comments
 (0)