Re: [master 1/2] Make loader log into syslog (so remote logging works for it as well) (#524980)

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

 



> +static const char * syslog_facility = "loader";
> +
> +/* maps our loglevel to syslog loglevel */
> +static int mapLogLevel(int level)
> +{
> +    int syslog_level;
> +    switch (level) {
> +    case DEBUGLVL:
> +        syslog_level = LOG_DEBUG;
> +        break;
> +    case INFO:
> +        syslog_level = LOG_INFO;
> +        break;
> +    case WARNING:
> +        syslog_level = LOG_WARNING;
> +        break;
> +    case CRITICAL:
> +        syslog_level = LOG_CRIT;
> +        break;
> +    case ERROR:
> +    default:
> +        /* if someone called us with an invalid level value, log it as an error
> +           too. */
> +        syslog_level = LOG_ERR;
> +        break;
> +    }
> +    return syslog_level;
> +}

You could simplify this down to just have each branch of the case
statement return LOG_* instead of setting a variable and then returning
that.

Otherwise, both patches look fine.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux