最近使用了 Python 中的concurrent.futures.ThreadPoolExecutor,submit 的任务在执行过程中出现了异常,但是日志却完全没有任何异常信息。
我找到了下面这些资料:
- Python ThreadPoolExecutor Suppress Exceptions - Stack Overflow
- java - Why is UncaughtExceptionHandler not called by ExecutorService? - Stack Overflow
使用 Python 中的ThreadPoolExecutor,有没有方法像 Java 中的Executor.execute(Runnable command)一样显式地输出异常信息?或者有什么方法像Thread.setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)一样设置异常处理器?
第 1 条附言 · 2020 年 12 月 2 日
1 条回复 • 2020-12-03 10:43:51 +08:00
|
1
tisswb 2020 年 12 月 3 日
可以用 logger 记录到日志文件中查看
|
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide