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

Re: [master] logging: refactor printLogHeader



If you're going to do this

> +const char *log_level_to_str[LOGLEVEL_MAX + 1] = {
> +    [DEBUGLVL] = "DEBUG",
> +    [INFO] = "INFO",
> +    [WARNING] = "WARN",
> +    [ERROR] = "ERR",
> +    [CRITICAL] = "CRIT"
> +};

Please fix this:

>  #define WARNING  30
>  #define ERROR    40
>  #define CRITICAL 50
> +#define LOGLEVEL_MAX CRITICAL

To be a real enum or at least not have gaps of 10 in it. That array doesn't
need 50 elements.

-- 
        Peter

Gravity is a habit that is hard to shake off.
		-- Pratchett

01234567890123456789012345678901234567890123456789012345678901234567890123456789


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