app/watchdog: Only log internal failures once

Logging internal failures to the phosphor-logger is a slow process that
can take up to 5 seconds. If we do this for each watchdog reset for a
relatively fast watchdog we will clog up the channel and fill the ESEL
log with errors. We probably don't want that kind of information to
build up. Instead, only report errors to the ESEL when the state of the
internal watchdog transitions from HEALTHY -> UNHEALTHY.

Tested:
    Works on zaius when booting and terminating the watchdog daemon
    while it is ticking. Produces the expected single error in the log
    and only delays the IPMI channel once.

Change-Id: I8110ba66c4a85e188666a34cb6d055bdbec30622
Signed-off-by: William A. Kennington III <wak@google.com>
1 file changed