high level system log, latching diagnostic warnings/error

asked 2018-01-19 04:27:14 -0600

knxa gravatar image

updated 2018-01-25 02:48:31 -0600

I would like a system log which contains only major events as well as all errors/warnings. I would like these data to appear runtime in the GUI as well as being saved to a file.

So the system log could look something like this:

[TIME x] Info   Started task XXX1
[TIME x] Info   Completed task XXX1

[TIME x] Info   Started task XXX2
[TIME x] Warn   Device A reports temperature T!
[TIME x] Info   Completed task XXX2

[TIME x] Info   Started task XXX1
[TIME x] Err    Motor B failed move action!
[TIME x] Info   Completed task XXX1 (failed)

This is pretty close to what the rqt_console is capable of, with the proper filters, but I would prefer a dedicated logger, automatically writing to a log file as well.

How can I include diagnostics events of warning/error level? It seems that the standard diagnostics components are less useful when an error occurs and goes away without any user monitoring the interface at that moment. Is there any ROS component that supports latching diagnostic warnings/errors, so the same warning/error is only posted/seen once? Or even better, having logged the moment an item changes level, for example [info->warning] and again on [warning->info].

My own way of doing this would be to create a node "/system_log_collector" which would

  • subscribe to /rosout_agg, and filter out only "warnings" and "errors", as well as some configurable selection of other log messages.
  • re-log all those messages to its own logger, e.g. system_log
  • find a way to ensure diagnostic data is logged when they appear with level warning/error. Does this exist or can it be done with diagnostic_aggregator and a runtime analyzer?

Any advice is appreciated, or in general: how do you present a quick chronological overview of what has occurred recently?

edit retag flag offensive close merge delete