Basic logging implemented

Implemented scuffed logging settings page
Add helper function to PathManager to create an arbitrary folder
This commit is contained in:
Rasmus Karlsson
2018-01-28 14:23:55 +01:00
parent f474db9443
commit 2f0844ebd9
14 changed files with 201 additions and 151 deletions
+36
View File
@@ -57,8 +57,44 @@ bool PathManager::init(int argc, char **argv)
return false;
}
this->logsFolderPath = rootPath + "/Logs";
if (!QDir().mkpath(this->logsFolderPath)) {
printf("Error creating logs directory: %s\n", qPrintable(this->logsFolderPath));
return false;
}
this->channelsLogsFolderPath = this->logsFolderPath + "/Channels";
if (!QDir().mkpath(this->channelsLogsFolderPath)) {
printf("Error creating channelsLogs directory: %s\n",
qPrintable(this->channelsLogsFolderPath));
return false;
}
this->whispersLogsFolderPath = this->logsFolderPath + "/Whispers";
if (!QDir().mkpath(this->whispersLogsFolderPath)) {
printf("Error creating whispersLogs directory: %s\n",
qPrintable(this->whispersLogsFolderPath));
return false;
}
this->mentionsLogsFolderPath = this->logsFolderPath + "/Mentions";
if (!QDir().mkpath(this->mentionsLogsFolderPath)) {
printf("Error creating mentionsLogs directory: %s\n",
qPrintable(this->mentionsLogsFolderPath));
return false;
}
return true;
}
bool PathManager::createFolder(const QString &folderPath)
{
return QDir().mkpath(folderPath);
}
} // namespace singletons
} // namespace chatterino