On Tue, May 4, 2021 at 11:24 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Wed, 28 Apr 2021 10:29:59 +0300 > "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > > > void tep_info(const char *fmt, ...) > > { > > va_list ap; > > > > if (log_level < TEP_LOG_INFO) > > return; > > > > va_start(ap, fmt); > > tep_vprint("libtraceevent", TEP_LOG_INFO fmt, ap); > > va_end(ap); > > } > > The above should just be: > > void tep_info(const char *fmt, ...) > { > va_list ap; > > va_start(ap, fmt); > tep_vprint("libtraceevent", TEP_LOG_INFO fmt, ap); > va_end(ap); > } > > And let the tep_vprint() decide to print it or not. The tep_vprint() is used also by libtacecmd and libtracefs for printing logs. Each library has its own log_level local variable, that's why I check the log level in the library specific log functions. > > -- Steve -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center