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/log_buffer.hpp b/src/log_buffer.hpp
index 24e7ad7..be1806b 100644
--- a/src/log_buffer.hpp
+++ b/src/log_buffer.hpp
@@ -37,25 +37,27 @@
      */
     LogBuffer(size_t maxSize, size_t maxTime);
 
+    virtual ~LogBuffer() = default;
+
     /**
      * @brief Add raw data from host's console output.
      *
      * @param[in] data pointer to raw data buffer
      * @param[in] sz size of the buffer in bytes
      */
-    void append(const char* data, size_t sz);
+    virtual void append(const char* data, size_t sz);
 
     /**
      * @brief Set handler called if buffer is full.
      *
      * @param[in] cb callback function
      */
-    void setFullHandler(std::function<void()> cb);
+    virtual void setFullHandler(std::function<void()> cb);
 
     /** @brief Clear (reset) container. */
-    void clear();
+    virtual void clear();
     /** @brief Check container for empty. */
-    bool empty() const;
+    virtual bool empty() const;
     /** @brief Get container's iterator. */
     container_t::const_iterator begin() const;
     /** @brief Get container's iterator. */