Added activation and deactivation of logging without restarting the application

This commit is contained in:
vladimir.kuznetsov
2022-12-28 06:52:02 +03:00
parent ce4ca5c4d5
commit 195663c6e3
3 changed files with 23 additions and 0 deletions
+8
View File
@@ -80,6 +80,14 @@ bool Debug::init()
return true;
}
void Debug::deInit()
{
qInstallMessageHandler(0);
qSetMessagePattern("%{message}");
m_textStream.setDevice(nullptr);
m_file.close();
}
QString Debug::userLogsDir()
{
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/log";