11 py::class_<Util::PyStdoutLoggerWrapper>(m,
"StdoutLoggerWrapper")
20 std::erase(Str,
'\r');
21 std::replace(Str.begin(), Str.end(),
'\n',
' ');
23 if (!Str.empty() && Str.find_first_not_of(
" ") != std::string::npos)
29 py::gil_scoped_acquire acquire;
32 py::module_::import(
"PyModuleStdoutLogger");
41 p = p.replace('debug/', '')
43 if '/vendor/vcpkg/installed/' in p and '/site-packages' in p:
44 p = p.replace('site-packages', 'lib-dynload')
53 py::gil_scoped_acquire acquire;
55 py::print(
"Importing Python modules from");
PYBIND11_EMBEDDED_MODULE(PyModuleStdoutLogger, m)
Provides utilities related to pybind11 within DynExp's Util namespace.
void Log(const std::string &Message, const ErrorType Type=ErrorType::Info, const size_t Line=0, const std::string &Function="", const std::string &File="", const int ErrorCode=0, const std::stacktrace &Trace={}) noexcept
Logs an event from information specified manually.
PyGilReleasedInterpreter()
py::module_ Module_sys
Handle to the Python sys module.
void PrintDebugInfo()
Writes information on the Python interpreter configuration to DynExp's log.
PyStdoutLoggerWrapper Logger
Wrapper to forward DynExp's event log to Python.
void write(std::string Str)
Formats the string passed to the function and writes it to the event log.
void flush()
Required, but does nothing.
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
EventLogger & EventLog()
This function holds a static EventLogger instance and returns a reference to it. DynExp uses only one...
Accumulates include statements to provide a precompiled header.