23 template <enum CVLog::MessageLevelFlags level>
class ccLogger
108 auto *wcharArray =
new wchar_t[
string.size() + 1];
109 const int len =
string.toWCharArray(wcharArray);
110 Q_ASSERT(len <=
string.
size());
111 wcharArray[len] =
'\0';
118 const wchar_t *pythonPath = Py_GetPath();
119 if (pythonPath !=
nullptr)
122 char *cPythonPath = Py_EncodeLocale(pythonPath, &errPos);
125 CVLog::Print(
"[PythonRuntime] PythonPath is set to: %s", cPythonPath);
126 PyMem_Free(cPythonPath);
130 CVLog::Print(
"[PythonRuntime] Failed to convert the PythonPath");
142 const wchar_t *pythonHome = Py_GetPythonHome();
143 if (pythonHome !=
nullptr)
146 char *cPythonHome = Py_EncodeLocale(pythonHome, &errPos);
149 CVLog::Print(
"[PythonRuntime] PythonHome is set to: %s", cPythonHome);
150 PyMem_Free(cPythonHome);
154 CVLog::Print(
"[PythonRuntime]Failed to convert the PythonHome path");
void LogPythonPath()
Logs the PYTHON_PATH the log console of ACloudViewer.
wchar_t * QStringToWcharArray(const QString &string)
Returns a newly allocated wchar_t array (null terminated) from a QString.
void LogPythonHome()
Logs the PYTHON_HOME the log console of ACloudViewer.
static bool Print(const char *format,...)
Prints out a formatted message in console.
static void LogMessage(const QString &message, int level)
Static shortcut to CVLog::logMessage.
ccLogger & operator<<(int value)
ccLogger & operator<<(const QString &message)
ccLogger & operator<<(const char *message)
ccLogger & operator<<(const qsizetype value)