Main Page   File List   Globals   Examples  

dlog.h File Reference

Contains a robust API for logging messages. More...

#include <syslog.h>

Go to the source code of this file.

Enumerations

enum  daemon_log_flags { DAEMON_LOG_SYSLOG = 1, DAEMON_LOG_STDERR = 2, DAEMON_LOG_STDOUT = 4, DAEMON_LOG_AUTO = 8 }
 Specifies where to send the log messages to. More...


Functions

void daemon_log (int prio, const char *t,...)
 Log a message using printf format strings using the specified syslog priority. More...

char* daemon_ident_from_argv0 (char *argv0)
 Return a sensible syslog identification for daemon_log_ident generated from argv[0]. More...


Variables

enum daemon_log_flags daemon_log_use
 This variable is used to specify the log target(s) to use. More...

char* daemon_log_ident
 Specifies the syslog identification, use daemon_ident_from_argv0() to set this to a sensible value or generate your own. More...


Detailed Description

Contains a robust API for logging messages.

Definition in file dlog.h.


Enumeration Type Documentation

enum daemon_log_flags
 

Specifies where to send the log messages to.

Enumeration values:
DAEMON_LOG_SYSLOG   Log messages are written to syslog.
DAEMON_LOG_STDERR   Log messages are written to STDERR.
DAEMON_LOG_STDOUT   Log messages are written to STDOUT.
DAEMON_LOG_AUTO   If this is set a daemon_fork() will change this to DAEMON_LOG_SYSLOG in the daemon process.

Definition at line 31 of file dlog.h.


Function Documentation

char * daemon_ident_from_argv0 ( char * argv0 )
 

Return a sensible syslog identification for daemon_log_ident generated from argv[0].

This will return a pointer to the file name of argv[0], i.e. strrchr(argv[0], '\')+1

Parameters:
argv0   argv[0] as passed to main()
Returns:
The identification string
Examples:
testd.c.

void daemon_log ( int prio,
const char * t,
... )
 

Log a message using printf format strings using the specified syslog priority.

Parameters:
prio   The syslog priority (PRIO_xxx constants)
t,...   The text message to log
Examples:
testd.c.


Variable Documentation

char * daemon_log_ident
 

Specifies the syslog identification, use daemon_ident_from_argv0() to set this to a sensible value or generate your own.

Definition at line 45 of file dlog.h.

enum daemon_log_flags daemon_log_use
 

This variable is used to specify the log target(s) to use.

Defaults to DAEMON_LOG_STDERR|DAEMON_LOG_AUTO

Definition at line 41 of file dlog.h.


Generated at Thu Nov 11 05:22:56 2010 for libdaemon by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001