[Sheepdog] [PATCH 5/5] logger: fix the vprintf() bug

Liu Yuan namei.unix at gmail.com
Thu Oct 13 10:18:06 CEST 2011


On 10/13/2011 03:58 PM, MORITA Kazutaka wrote:
> AndyChen changes the macro in this patch:
>
> ==
> diff --git a/include/logger.h b/include/logger.h
> index cdd7642..461f2d9 100644
> --- a/include/logger.h
> +++ b/include/logger.h
> @@ -64,14 +64,14 @@ extern void log_write(int prio, const char *func, int line, const char *fmt, ...
>   #define	SDOG_INFO		LOG_INFO
>   #define	SDOG_DEBUG		LOG_DEBUG
>
> -#define vprintf(fmt, args...)						\
> +#define vprintf(level, fmt, args...)						\
>   do {									\
> -	log_write(LOG_INFO, __func__, __LINE__, fmt, ##args);		\
> +	log_write(level, __func__, __LINE__, fmt, ##args);		\
>   } while (0)
>   ==
>
> The definitions of log levels are changed to integers by the 3rd
> patch.  I think the intention of this patch is not fixing a bug but
> making it clear how to specify the log level.
>
> Anyway, should we change the name of dprintf() and vprintf()?  These
> names are already in POSIX functions and it is a bit confusing.
>

Maybe yes, but I am quit okay with the current dprintf, vprintf naming. 
They are both short.  anyone has a good suggestion for the new name?

Thanks,
Yuan



More information about the sheepdog mailing list