Re: [PATCH 3/4] libtraceevent: Rename tep_vwarning() to tep_vprint()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 28 Apr 2021 10:30:00 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> @@ -24,11 +24,11 @@ void tep_set_loglevel(enum tep_loglevel level)
>  	log_level = level;
>  }
>  
> -int __weak tep_vwarning(const char *name, const char *fmt, va_list ap)
> +int __weak tep_vprint(const char *name, enum tep_loglevel level, const char *fmt, va_list ap)
>  {
>  	int ret = errno;
>  
> -	if (errno)
> +	if (errno && level <= TEP_LOG_WARNING)
>  		perror(name);
>  
>  	fprintf(stderr, "  ");

If this is passing in a log level, why not just have:

	if (level < loglevel)
		return 0;

?

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux