Add multi-host support

This refactoring includes:
- added multi-host mode support;
- added support for graceful shutdown of the service;
- added support to flush the log buffer as it fills;
- D-Bus service xyz.openbmc_project.HostLogger replaced with SIGUSR1
  signal handler;
- self diagnostic messages now registered via phosphor-logging;
- added unit tests;
- build system migrated from autotools to meson;
- source code aligned with OpenBMC conventions.

Change-Id: If6c1dfde278af685d8563450543a6587a282c7e4
Signed-off-by: Artem Senichev <a.senichev@yadro.com>
diff --git a/test/zlib_file_test.cpp b/test/zlib_file_test.cpp
new file mode 100644
index 0000000..ef49a6f
--- /dev/null
+++ b/test/zlib_file_test.cpp
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2020 YADRO
+
+#include "zlib_exception.hpp"
+#include "zlib_file.hpp"
+
+#include <gtest/gtest.h>
+
+TEST(ZlibFileTest, Exception)
+{
+    ASSERT_THROW(ZlibFile("invalid/path"), ZlibException);
+}
+
+TEST(ZlibFileTest, Write)
+{
+    const std::string msg = "Test message";
+    time_t currTime;
+    time(&currTime);
+    tm localTime;
+    localtime_r(&currTime, &localTime);
+
+    const std::string path = "/tmp/zlib_file_test.out";
+    ZlibFile file(path);
+    file.write(localTime, msg);
+    file.close();
+
+    char expect[64];
+    const int len = snprintf(expect, sizeof(expect), "[ %02i:%02i:%02i ] %s\n",
+                             localTime.tm_hour, localTime.tm_min,
+                             localTime.tm_sec, msg.c_str());
+
+    gzFile fd = gzopen(path.c_str(), "r");
+    ASSERT_TRUE(fd);
+    char buf[64];
+    memset(buf, 0, sizeof(buf));
+    EXPECT_EQ(gzread(fd, buf, sizeof(buf)), len);
+    EXPECT_STREQ(buf, expect);
+    EXPECT_EQ(gzclose(fd), 0);
+
+    unlink(path.c_str());
+}