lf-lang / reactor-uc

A lightweight reactor runtime targeted at resource-constrained embedded systems
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

Add logging #51

Closed erlingrj closed 2 weeks ago

erlingrj commented 3 weeks ago

It is overdue to implement a logging system. I want it to be simple but flexible. I want

Zephyr has a particularly nice logging system and I want our logging to match nicely to that: https://docs.zephyrproject.org/latest/services/logging/index.html

For other targets we can chose to either:

  1. Implement the nice logging system with multiple modules or
  2. Just check global verbosity level and dump everything out over printf.
tanneberger commented 2 weeks ago

@LasseRosenow is there a nice riot-os logging module the only thing I found is: https://doc.riot-os.org/core_2lib_2include_2log_8h.html

erlingrj commented 2 weeks ago

I am looking at this currently :)

LasseRosenow commented 2 weeks ago

@LasseRosenow is there a nice riot-os logging module the only thing I found is: https://doc.riot-os.org/core_2lib_2include_2log_8h.html

From my knowledge in RIOT it is common to just use printf and then hide Debug prints behind the DEBUG define, which can be overwritten on a per-file basis.

This logging system that you are referencing there is the better alternative to that in my view, but usage of it is somewhat "random".

erlingrj commented 2 weeks ago

A first iteration of flexible logging system is now in main