Handle short name of OS status

The x86-power-control project uses short names for OS status in D-Bus,
for instance, "Inactive" instead of
"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive".
From now on, hostlogger flushes the logs when the system goes into an
Inactive or Standby state.

Resolves #1.

Change-Id: I2b178d4086e19a2cf15825cf3ad2529e7b053dcc
Signed-off-by: Artem Senichev <a.senichev@yadro.com>
diff --git a/README.md b/README.md
index 5c7dd3c..0c08f13 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,39 @@
 - `MAX_FILES`: Log files rotation, max number of files in the output directory,
   oldest files are removed. The default value is `10` (0=unlimited).
 
+### Example
+
+#### Remove file limits
+
+Relevant for OpenPOWER based servers, using `ttyVUART0` for console.
+
+File `phosphor-hostlogger_%.bbappend`:
+```
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append = " file://ttyVUART0.conf"
+```
+
+File `phosphor-hostlogger/ttyVUART0.conf`:
+```
+MAX_FILES=0
+```
+
+#### Custom object for host state monitoring
+
+Relevant for x86 based servers: using `ttyS2` for console and
+`/xyz/openbmc_project/state/os` for host state monitoring.
+
+File `phosphor-hostlogger_%.bbappend`:
+```
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append = " file://ttyS2.conf"
+```
+
+File `phosphor-hostlogger/ttyS2.conf`:
+```
+HOST_STATE=/xyz/openbmc_project/state/os
+```
+
 ## Multi-host support
 
 The single instance of the service can handle only one host console at a time.
diff --git a/src/service.cpp b/src/service.cpp
index eda8545..a5610e4 100644
--- a/src/service.cpp
+++ b/src/service.cpp
@@ -10,7 +10,14 @@
 using namespace phosphor::logging;
 
 // clang-format off
-/** @brief Host state properties. */
+/** @brief Host state monitor properties.
+ *  Used for automatic flushing the log buffer to the persistent file.
+ *  Contains a list of properties and a set of their values that trigger the
+ *  flush operation.
+ *  For example, the current log buffer will be saved to a file when the
+ *  "OperatingSystemState" property obtains one of the
+ *  listed values ("xyz.openbmc_project...BootComplete", "Inactive", etc).
+ */
 static const DbusLoop::WatchProperties watchProperties{
   {"xyz.openbmc_project.State.Host", {{
     "RequestedHostTransition", {
@@ -18,7 +25,9 @@
   {"xyz.openbmc_project.State.OperatingSystem.Status", {{
     "OperatingSystemState", {
       "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete",
-      "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive"}}}}
+      "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
+      "Inactive",
+      "Standby"}}}}
 };
 // clang-format on