diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-23 15:45:08 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-23 15:45:08 -0400 |
commit | bd64e83e46db7cd8167d9a7bab2945a9136497ea (patch) | |
tree | 044d28690b82843401ba23b44af74db50801d464 /python | |
parent | 7ee583a448a3ddf343cc609c62f17da7e9e82090 (diff) | |
download | fork-ledger-bd64e83e46db7cd8167d9a7bab2945a9136497ea.tar.gz fork-ledger-bd64e83e46db7cd8167d9a7bab2945a9136497ea.tar.bz2 fork-ledger-bd64e83e46db7cd8167d9a7bab2945a9136497ea.zip |
Added tracing statements to the Python interpreter binding code.
Diffstat (limited to 'python')
-rw-r--r-- | python/pyinterp.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/pyinterp.cc b/python/pyinterp.cc index ab8f4b8b..a38def60 100644 --- a/python/pyinterp.cc +++ b/python/pyinterp.cc @@ -90,6 +90,8 @@ python_interpreter_t::python_interpreter_t() : session_t(), main_nspace() { TRACE_CTOR(python_interpreter_t, ""); + TRACE_START(python_init, 1, "Initialized Python"); + DEBUG("python.interp", "Initializing Python"); Py_Initialize(); @@ -102,6 +104,8 @@ python_interpreter_t::python_interpreter_t() : session_t(), main_nspace() throw_(std::logic_error, "Python failed to initialize"); boost::python::detail::init_module("ledger", &initialize_for_python); + + TRACE_FINISH(python_init, 1); } object python_interpreter_t::import(const string& str) @@ -109,7 +113,7 @@ object python_interpreter_t::import(const string& str) assert(Py_IsInitialized()); try { - DEBUG("python.interp", "Importing Python module: " << str); + TRACE_START(python_import, 1, "Imported Python module: " << str); object mod = boost::python::import(str.c_str()); if (! mod) @@ -118,6 +122,8 @@ object python_interpreter_t::import(const string& str) // Import all top-level entries directly into the main namespace main_nspace.update(mod.attr("__dict__")); + TRACE_FINISH(python_import, 1); + return mod; } catch (const error_already_set&) { |