I recommend to use it especially with the DEBUG_MODE flag connected to the makefile. Thanks to that we could switch off the logger e.g by changing the project build mode from “debug” to “release”. Logger syntax is the same as fprintf, but it prints not only a formatted string, but also a filename and a line number where logger was called. It is very helpful if we want to find a source of a specific log entry. All logs can be gathered in a log file, stdout, stderr etc. thanks to the “stream” variable.

Next look at the MALLOC which might be used instead of simple malloc function.

Using this macro we don’t need to remember about a type casting and the type size. We have to provide only a typename and a number of memory blocks (eg. array size). Our code will be more readable. Furthermore, we don’t need to worry that our variable won’t be initialized. It is important especially for the embeeded systems. Moreover, our program will inform us about the “out of memory” error. I also connect the MALLOC macro with the logger, so it is possible to print an information about the place where specific MALLOC was called. It might be useful for debugging purposes.

The last macro I want to describe is FREE. It will free a memory allocated by MALLOC macro.