Re: [vdagent-win PATCH 2/3] Expand PRINT_LINE macros

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

 



Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

On Wed, Jul 26, 2017 at 11:03:41AM +0100, Frediano Ziglio wrote:
> This complicated macro was used as an helper for LOG macro
> which expand PRINT_LINE macro twice. Now that LOG expand PRINT_LINE
> only once there's no need to have this macro which make logging code
> more complicated.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  common/vdlog.h | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/common/vdlog.h b/common/vdlog.h
> index b1be391..9f08fc4 100644
> --- a/common/vdlog.h
> +++ b/common/vdlog.h
> @@ -58,10 +58,6 @@ static const VDLogLevel log_level = LOG_DEBUG;
>  static const VDLogLevel log_level = LOG_INFO;
>  #endif
>  
> -#define PRINT_LINE(type, format, datetime, ms, ...)                     \
> -    printf("%lu::%s::%s,%.3d::%s::" format "\n", GetCurrentThreadId(), type, datetime, ms, \
> -           __FUNCTION__, ## __VA_ARGS__);
> -
>  #define LOG(type, format, ...) do {                                     \
>      if (type >= log_level && type <= LOG_FATAL) {                       \
>          const char *type_as_char[] = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL" }; \
> @@ -71,7 +67,10 @@ static const VDLogLevel log_level = LOG_INFO;
>          _ftime_s(&now);                                                 \
>          localtime_s(&today, &now.time);                                 \
>          strftime(datetime_str, 20, "%Y-%m-%d %H:%M:%S", &today);        \
> -        VDLog::PRINT_LINE(type_as_char[type], format, datetime_str, now.millitm, ## __VA_ARGS__); \
> +        VDLog::printf("%lu::%s::%s,%.3d::%s::" format "\n",             \
> +                      GetCurrentThreadId(), type_as_char[type],         \
> +                      datetime_str, now.millitm,                        \
> +                      __FUNCTION__, ## __VA_ARGS__);                    \
>      }                                                                   \
>  } while(0)
>  
> -- 
> 2.13.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]