This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "tracing.h"
|
||||
#include "utilityString.h"
|
||||
#include "utilityUuid.h"
|
||||
#include "FileLogger.h"
|
||||
|
||||
std::shared_ptr<Application> Application::s_instance;
|
||||
std::string Application::s_uuid;
|
||||
@@ -112,6 +113,13 @@ void Application::loadSettings()
|
||||
settings->load(UserPaths::getAppSettingsPath());
|
||||
|
||||
LogManager::getInstance()->setLoggingEnabled(settings->getLoggingEnabled());
|
||||
Logger* logger = LogManager::getInstance()->getLoggerByType("FileLogger");
|
||||
if (logger)
|
||||
{
|
||||
const auto fileLogger = dynamic_cast<FileLogger*>(logger);
|
||||
fileLogger->setLogDirectory(settings->getLogDirectoryPath());
|
||||
fileLogger->setFileName(FileLogger::generateDatedFileName(L"log"));
|
||||
}
|
||||
|
||||
loadStyle(settings->getColorSchemePath());
|
||||
}
|
||||
|
||||
@@ -337,6 +337,17 @@ void ApplicationSettings::setVerboseIndexerLoggingEnabled(bool value)
|
||||
setValue<bool>("application/verbose_indexer_logging_enabled", value);
|
||||
}
|
||||
|
||||
FilePath ApplicationSettings::getLogDirectoryPath() const
|
||||
{
|
||||
return FilePath(getValue<std::wstring>(
|
||||
"application/log_directory_path", UserPaths::getLogPath().getAbsolute().wstr()));
|
||||
}
|
||||
|
||||
void ApplicationSettings::setLogDirectoryPath(const FilePath &path)
|
||||
{
|
||||
setValue<std::wstring>("application/log_directory_path", path.wstr());
|
||||
}
|
||||
|
||||
void ApplicationSettings::setLogFilter(int mask)
|
||||
{
|
||||
setValue<int>("application/log_filter", mask);
|
||||
|
||||
@@ -82,6 +82,9 @@ public:
|
||||
bool getVerboseIndexerLoggingEnabled() const;
|
||||
void setVerboseIndexerLoggingEnabled(bool loggingEnabled);
|
||||
|
||||
FilePath getLogDirectoryPath() const;
|
||||
void setLogDirectoryPath(const FilePath& path);
|
||||
|
||||
int getLogFilter() const;
|
||||
void setLogFilter(int mask);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user