chatgui: лог по умолчанию в файл chatgui.log (debug_file)

This commit is contained in:
evgeny committed 2026-09-04 13:25:06 +03:00
1 parent 656da48e35
commit 20eef8ad16
3 files changed
+12

No files matched your search

+9
View File
@@ -135,6 +135,15 @@ int main(int argc, char *argv[]) {
cfg.save();
}
QString debugFile = cfg.debugFile();
if (debugFile.isEmpty()) debugFile = "chatgui.log";
if (!QDir::isAbsolutePath(debugFile))
debugFile = QCoreApplication::applicationDirPath() + "/" + debugFile;
if (cfg.debugFile() != debugFile) {
cfg.setDebugFile(debugFile);
cfg.save();
}
DbManager db;
MainWindow w(nullptr, &db, cfgPath, dbPath, cfg.debugFile(),
cfg.debugLevel(), cfg.debugCategories());
+2
View File
@@ -182,6 +182,8 @@ bool NodeConfig::create(const QString& nodeName, quint16 listenPort) {
m_autoSockets = true;
if (m_dbPath.isEmpty())
m_dbPath = "chat_data";
if (m_debugFile.isEmpty())
m_debugFile = "chatgui.log";
return save();
}
+1
View File
@@ -49,6 +49,7 @@ public:
QString dbPath() const { return m_dbPath; }
void setDbPath(const QString& p) { m_dbPath = p; }
QString debugFile() const { return m_debugFile; }
void setDebugFile(const QString& p) { m_debugFile = p; }
QString debugLevel() const { return m_debugLevel; }
QString debugCategories() const { return m_debugCategories; }