-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
5
In order to avoid unnecessary string allocations when we call log_msg() with trace_type greater than _trace_level we should use macros that will check log level before calling the log method. It can look similar to this:
#define LOG(lvl, msg) \ do { \ if (_trace_level >= lvl) \ log_msg(lvl, msg); \ } while (0)