<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I’ve just pushed a big git commit to standardise the support for logging levels in OVMS v3. These notes should help keep things organised:</div><div class=""><br class=""></div><div class=""><ol class="MailOutline"><li class="">All OVMS code should now have this near the top of it’s code:<br class=""><br class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">  #include "ovms_log.h"<br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">  static const char *TAG = “<some-tag>";</span></font></div><br class="">Please don’t use esp_log.h directly, but instead always use ovms_log.h.<br class=""><br class="">Please do use just one tag for your module - something short, sweet, unique, easy to type, and descriptive.<br class=""><br class="">This ovms_log.h module redefines the standard ESP_LOG? macros to something more useful for our environment. In particular, they move the implementation of logging level control from compile-time to run-time.<br class=""><br class=""></li><li class="">ESP has five logging levels. The intended use of these levels is as follows:<br class=""><br class=""></li><ul class=""><li class="">ESP_LOGE(TAG, format, values…)<br class="">Intended for logging errors. Non-recoverable, or otherwise serious, issues that should be shown to users.<br class=""><br class=""></li><li class="">ESP_LOGW(TAG, format, values…)<br class="">Intended for logging warnings. Recoverable, or minor, issues that should be shown to users.<br class=""><br class=""></li><li class="">ESP_LOGI(TAG, format, values…)<br class="">Informational messages. Primarily intended for developers or advanced users of the system, providing an insight into the state of the code paths.<br class=""><br class=""></li><li class="">ESP_LOGD(TAG, format, values…)<br class="">Debug messages. Intended for developers, or people debugging issues, these provide detailed diagnostic information.<br class=""><br class=""></li><li class="">ESP_LOGV(TAG, format, values…)<br class="">Verbose messages. Extremely detailed, intended for developers only.<br class=""><br class=""></li></ul><li class="">The default logging level is set in menuconfig (Component -> Log -> Default log verbosity). In sdkconfig.default, this is now set to ‘warning’ (ESP_LOGW) and is configured as such during system boots. Log messages of severity equal to, or above, this log level will be displayed. The log level can be set at runtime with the console ‘level’ command. In particular, it can be set globally (for tag ‘*’), or per-tag. You can also put these level commands in a script if you want it set to anything other than the default (so, for example, I could have the vehicle module I am working on at debug log level, but everything else at warnings only).</li></ol></div><div class=""><br class=""></div><div class="">I hope that the above is understandable and useful. It may not be perfect, and may need some tuning over time, but it should be workable now.</div><div class=""><br class=""></div><div class="">Regards, Mark.</div><div class=""><br class=""></div></body></html>