MCPcopy Create free account
hub / github.com/colmap/colmap / GetPythonCallFrame

Function GetPythonCallFrame

src/pycolmap/util/logging.cc:21–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}; // dummy class
20
21std::pair<std::string, int> GetPythonCallFrame() {
22 const auto frame = py::module_::import("sys").attr("_getframe")(0);
23 const std::string file = py::str(frame.attr("f_code").attr("co_filename"));
24 const std::string function = py::str(frame.attr("f_code").attr("co_name"));
25 const int line = py::int_(frame.attr("f_lineno"));
26 return std::make_pair(file + ":" + function, line);
27}
28
29void BindLogging(py::module& m) {
30 py::classh<Logging> PyLogging(m, "logging", py::module_local());

Callers 1

BindLoggingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected