summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/Logger.cpp
diff options
context:
space:
mode:
authorZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-07-31 17:08:49 +0200
committerZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-07-31 17:08:49 +0200
commitde2c473ef6cb27a080bb0491f21d1280e2c971c5 (patch)
tree7189bf00de07ea69fe29ee0a1435e7b65316a8d4 /lib/Plugins/Logger.cpp
parent3f89291d3dbb6ebd28cf7aaa1cbde24b27810bfc (diff)
downloadabrt-de2c473ef6cb27a080bb0491f21d1280e2c971c5.tar.gz
abrt-de2c473ef6cb27a080bb0491f21d1280e2c971c5.tar.xz
abrt-de2c473ef6cb27a080bb0491f21d1280e2c971c5.zip
added new interface for geting plugins' settings (will be used in gui)
Diffstat (limited to 'lib/Plugins/Logger.cpp')
-rw-r--r--lib/Plugins/Logger.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp
index 5e99cf9..1dd5a28 100644
--- a/lib/Plugins/Logger.cpp
+++ b/lib/Plugins/Logger.cpp
@@ -21,7 +21,6 @@
#include "Logger.h"
#include <fstream>
-#include "PluginSettings.h"
#include <sstream>
#include "DebugDump.h"
#include "CommLayerInner.h"
@@ -33,19 +32,34 @@ CLogger::CLogger() :
void CLogger::LoadSettings(const std::string& pPath)
{
- map_settings_t settings;
+ map_plugin_settings_t settings;
plugin_load_settings(pPath, settings);
- if (settings.find("LogPath")!= settings.end())
+ SetSettings(settings);
+}
+
+void CLogger::SetSettings(const map_plugin_settings_t& pSettings)
+{
+ if (pSettings.find("LogPath") != pSettings.end())
{
- m_sLogPath = settings["LogPath"];
+ m_sLogPath = pSettings.find("LogPath")->second;
}
- if (settings.find("AppendLogs")!= settings.end())
+ if (pSettings.find("AppendLogs") != pSettings.end())
{
- m_bAppendLogs = settings["AppendLogs"] == "yes";
+ m_bAppendLogs = pSettings.find("AppendLogs")->second == "yes";
}
}
+map_plugin_settings_t CLogger::GetSettings()
+{
+ map_plugin_settings_t ret;
+
+ ret["LogPath"] = m_sLogPath;
+ ret["AppendLogs"] = m_bAppendLogs ? "yes" : "no";
+
+ return ret;
+}
+
void CLogger::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs)
{
comm_layer_inner_status("Creating a report...");