Skip to content

make logging configurable during compilation and runtime

Maxim Onciul requested to merge configurable_log_level into master

Compile-time:

  • A new meson option 'log_level' is introduced which has all the values from the Loglevel enum
  • The 'OFF' option defines EMPER_LOG_OFF which causes the LOG* macros to be empty and the Logger<>::log function to return immediately
  • The default 'automatic' option sets 'log_level' to 'Error' for release buand to 'ALL' otherwise

Runtime:

  • The global variable emper::log_level defined in Debug.hpp controls the logging output
  • It is initialized with the meson option 'log_level' but can be changed during runtime
Edited by Maxim Onciul

Merge request reports

Loading