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/test/file_storage_mock.hpp b/test/file_storage_mock.hpp
new file mode 100644
index 0000000..449ab29
--- /dev/null
+++ b/test/file_storage_mock.hpp
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2021 GOOGLE
+
+#pragma once
+
+#include "file_storage.hpp"
+
+#include <gmock/gmock.h>
+
+class FileStorageMock : public FileStorage
+{
+  public:
+    FileStorageMock() : FileStorage("/tmp", "fake", -1)
+    {}
+    MOCK_METHOD(std::string, save, (const LogBuffer& buf), (const override));
+};