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/host_console.hpp b/src/host_console.hpp
index b0369af..73a5bfd 100644
--- a/src/host_console.hpp
+++ b/src/host_console.hpp
@@ -19,7 +19,7 @@
      */
     HostConsole(const std::string& socketId);
 
-    ~HostConsole();
+    virtual ~HostConsole();
 
     /**
      * @brief Connect to the host's console via socket.
@@ -27,7 +27,7 @@
      * @throw std::invalid_argument if socket ID is invalid
      * @throw std::system_error in case of other errors
      */
-    void connect();
+    virtual void connect();
 
     /**
      * @brief Non-blocking read data from console's socket.
@@ -39,10 +39,10 @@
      *
      * @return number of actually read bytes
      */
-    size_t read(char* buf, size_t sz) const;
+    virtual size_t read(char* buf, size_t sz) const;
 
     /** @brief Get socket file descriptor, used for watching IO. */
-    operator int() const;
+    virtual operator int() const;
 
   private:
     /** @brief Socket Id. */