Use enum class in logger-config as it is possible to serialize now. 36/49936/2
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Wed, 21 Oct 2015 16:32:34 +0000 (18:32 +0200)
committerJan Olszak <j.olszak@samsung.com>
Thu, 22 Oct 2015 13:37:28 +0000 (06:37 -0700)
[Bug/Feature]   N/A
[Cause]         To keep things clean and consistent
[Solution]      N/A
[Verification]  Build, run the junk tester

Change-Id: I75e55448a5f7c559882c6433dc82fae60ab2083b

libs/lxcpp/guard/guard.cpp
libs/lxcpp/logger-config.cpp
libs/lxcpp/logger-config.hpp

index f96fe7a..bc5f112 100644 (file)
@@ -63,9 +63,9 @@ Guard::Guard(const int channelFD)
     mChannel.setCloseOnExec(true);
     config::loadFromFD(mChannel.getFD(), mConfig);
 
-    logger::setupLogger(mConfig.mLogger.getType(),
-                        mConfig.mLogger.getLevel(),
-                        mConfig.mLogger.getArg());
+    logger::setupLogger(mConfig.mLogger.mType,
+                        mConfig.mLogger.mLevel,
+                        mConfig.mLogger.mArg);
 
     LOGD("Config & logging restored");
 
index 3aed302..ff0e407 100644 (file)
@@ -39,8 +39,8 @@ void LoggerConfig::set(const logger::LogType type,
         }
     }
 
-    mType = static_cast<int>(type);
-    mLevel = static_cast<int>(level);
+    mType = type;
+    mLevel = level;
     mArg = arg;
 }
 
index 8312623..52f0514 100644 (file)
@@ -35,21 +35,16 @@ namespace lxcpp {
 /**
  * Logger configuration
  */
-struct LoggerConfig {
-private:
-    int mType;
-    int mLevel;
+struct LoggerConfig
+{
+    logger::LogType mType;
+    logger::LogLevel mLevel;
     std::string mArg;
 
-public:
     void set(const logger::LogType type,
              const logger::LogLevel level,
              const std::string &arg = "");
 
-    logger::LogType getType() const {return static_cast<logger::LogType>(mType);}
-    logger::LogLevel getLevel() const {return static_cast<logger::LogLevel>(mLevel);}
-    std::string getArg() const {return mArg;}
-
     CONFIG_REGISTER
     (
         mType,