Add the stream mode

The stream mode behaves differently in versus the existing buffer mode.

1. It leverages rsyslog to persist logs;
2. It leverages logrotate to rotate and compress logs;
3. It persists logs as soon as they are collected.

Add configuration options to choose modes at start up time. When stream
mode is disabled, no difference compared to the existing service.

See README.md for details.

This change also adds mock classes for unit test purpose.

Change-Id: Ic7d02e826c7d9372621c096c6e768e6216974150
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
diff --git a/src/dbus_loop.hpp b/src/dbus_loop.hpp
index eeb5327..a96d5ac 100644
--- a/src/dbus_loop.hpp
+++ b/src/dbus_loop.hpp
@@ -26,14 +26,14 @@
     using WatchProperties = std::map<std::string, Properties>;
 
     DbusLoop();
-    ~DbusLoop();
+    virtual ~DbusLoop();
 
     /**
      * @brief Run worker loop.
      *
      * @return exit code from loop
      */
-    int run() const;
+    virtual int run() const;
 
     /**
      * @brief Stop worker loop.
@@ -53,9 +53,9 @@
      *
      * @throw std::system_error in case of errors
      */
-    void addPropertyHandler(const std::string& objPath,
-                            const WatchProperties& props,
-                            std::function<void()> callback);
+    virtual void addPropertyHandler(const std::string& objPath,
+                                    const WatchProperties& props,
+                                    std::function<void()> callback);
 
     /**
      * @brief Add IO event handler.
@@ -65,7 +65,7 @@
      *
      * @throw std::system_error in case of errors
      */
-    void addIoHandler(int fd, std::function<void()> callback);
+    virtual void addIoHandler(int fd, std::function<void()> callback);
 
     /**
      * @brief Add signal handler.
@@ -75,7 +75,7 @@
      *
      * @throw std::system_error in case of errors
      */
-    void addSignalHandler(int signal, std::function<void()> callback);
+    virtual void addSignalHandler(int signal, std::function<void()> callback);
 
   private:
     /**