3

I just want to know, what is the difference between esp's ESP_LOGx and printf, related to memory use and its other features. And which is the best to use for log ESP_LOGI, printf or any other logging function?

Jonas
  • 121,568
  • 97
  • 310
  • 388
horsemann07
  • 79
  • 1
  • 7

2 Answers2

3

I think that for most of ad hoc debuging this it is a matter of preference with indication to use printf.

ESP_LOG(I/W/E) are intended to implement "permanent" logging functionality in the code and is also used in the ESP-IDF itself. Then depending on debugging scenario it is possible to globally or locally enable required verbosity levels of information to receive.

1

Dont use printf, use ESP_LOGI/E/W. There are several advantages, for example color coded messages. enter image description here

ambassallo
  • 924
  • 1
  • 12
  • 27