Produce more useful error messages
A typical configuration on a physical box right now includes just one
input source which watches all systemd units on a system. When a change
happens, this source produced a `trace` message which was not visible by
default, and the manager logged a `debug` message (which was visible via
br2-external's config). However, no useful information can be provided
in the StateManager because essentially all the events are generated by
just a single input source, so they are "masked" behind a single source.
Solve this by changing the logging priorities, and also tweak the
messages a bit so that they include more details about what's going on
and fewer assumptions about velia's internal structure.
Instead of this:
main[276]: Input 0x15edb4c changed state to State::OK
main[276]: Output changed to State::OK
...now we get this:
main[675]: Systemd unit 'dev-ttyS2.device' changed state (active plugged)
main[675]: Status: State::OK
At first I tried to implement this via enforcing all input sources to
inherit from AbstractInput and extending that class with a `std::string
what() const` method, but that did not work because all systemd events
are sent by a single source.
Change-Id: I45873dba3d0314c8192b00b77f608c3b8d6591d9
3 files changed