traceback — Print or retrieve a stack traceback¶ Source code: Lib/traceback.py This module provides a standard interface to extract, format and print stack traces of Python programs. It exactly mimics the behavior of the Python interpreter when it prints a stack trace. This is useful when you want to print stack traces under program control, such as in a “wrapper” around the interpreter. The modul
traceback — Print or retrieve a stack traceback¶ Source code: Lib/traceback.py This module provides a standard interface to extract, format and print stack traces of Python programs. It exactly mimics the behavior of the Python interpreter when it prints a stack trace. This is useful when you want to print stack traces under program control, such as in a “wrapper” around the interpreter. The modul
これは、なにをしたくて書いたもの? Pythonで、動作しているスレッドのスタックトレースを出力する方法は?ということで。 環境 今回の環境は、こちら。 $ python3 -V Python 3.8.10 使う標準ライブラリ 今回の目的は、このあたりを使えば良さそうです。 traceback --- スタックトレースの表示または取得 — Python 3.8.10 ドキュメント sys --- システムパラメータと関数 — Python 3.8.10 ドキュメント threading --- スレッドベースの並列処理 — Python 3.8.10 ドキュメント 以降、これらを使ってちょっと試していきたいと思います。 スタックトレースを出力するコードを埋め込む まずは、スタックトレースを出力したい処理自体の中に、スタックトレースを出力するコードを埋め込んでみます。 thread_dump
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く