FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 02-23-2010, 05:40 PM
Chris Lumens
 
Default Make loader log into syslog (so remote logging works for it as well) (#524980)

> +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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org