logconfig.h File Reference

Airframe Logging Configuration Support. More...

#include <airframe/autoinc.h>

Go to the source code of this file.

Defines

#define LOGC_ERROR_DOMAIN   (g_quark_from_string("airframeLogError"))
 GError domain for logconfig errors.
#define LOGC_ERROR_ARGUMENT   1
 Logconfig argument error.

Functions

GOptionGroup * logc_option_group (const char *appname, const char *version)
 Return a GOptionGroup for logging configuration.
gboolean logc_setup (GError **err)
 Set up log routing.


Detailed Description

Airframe Logging Configuration Support.

Supplies glib log routing to standard error, file output, and the UNIX syslog facility, and the command line option processing necessary to use it. Integrates with daeconfig to ensure proper use of standard error, and to default to standard error or syslog as appropriate. Use this when your application uses glib logging and you want to give your users control over where to route logging information via the command line.


Define Documentation

#define LOGC_ERROR_ARGUMENT   1
 

Logconfig argument error.

The user passed in an illegal command-line argument.


Function Documentation

GOptionGroup* logc_option_group const char *  appname,
const char *  version
 

Return a GOptionGroup for logging configuration.

This GOptionGroup defines four options: --log (-l) to specify a logging destination, --loglevel (-L) to specify the minimum severity of logged messages, --verbose (-v) which is a shortcut for --loglevel debug, and --version (-V) which will print version information and exit the application.

Parameters:
appname application name to display
version application version string
Returns:
a logconfig GOptionGroup

gboolean logc_setup GError **  err  ) 
 

Set up log routing.

Call this after parsing an options context including a GOptionGroup returned from logc_option_group(). This sets up log routing using logconfig; subsequent glib logging calls will be routed as specified by the user.

By default, if the application will fork to the background logging is routed to standard error; otherwise, it is routed to the "user" syslog facility. In either case, the default loglevel is warning.

Parameters:
err an error description
Returns:
TRUE on success, FALSE otherwise.


© 2005-2006 Carnegie Mellon University
Generated Thu Jun 15 10:08:41 2006 for Airframe 0.6.2 by Doxygen 1.4.5.