dlog.h(3)
dlog.h(3) β the Library Functions Manual, but make it cute β¨
okay so bestie, welcome to dlog.h(3) π this is the manual page from the Library Functions Manual, and it's literally all about libdaemon's logging header. no cap, this thing is the blueprint for making your daemon actually tell you what it's doing. let's get into it π«Ά
πΈ NAME πΈ
dlog.h β Contains a robust API for logging messages.
that's it. that's the name section. a header, containing a robust API, for logging messages. iconic, honestly.
β¨ SYNOPSIS β¨
#include <syslog.h>
#include <stdarg.h>
π Macros π
#define DAEMON_GCC_PRINTF_ATTR(a, b)β A macro for making use of GCCs printf compilation warnings.#define DAEMON_LOGV_AVAILABLE 1β This variable is defined to 1 iffdaemon_logv()is supported.#define DAEMON_SET_VERBOSITY_AVAILABLE 1β This variable is defined to 1 iffdaemon_set_verbosity()is available.
π¦ 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.
β Functions β
void daemon_log (int prio, const char *t,...) DAEMON_GCC_PRINTF_ATTR(2β Log a message using printf format strings using the specified syslog priority.void daemon_logv (int prio, const char *t, va_list ap)β Same asdaemon_log(), but without variadic arguments.char * daemon_ident_from_argv0 (char *argv0)β Return a sensible syslog identification fordaemon_log_identgenerated fromargv[0].void daemon_set_verbosity (int verbosity_prio)β Setter for the verbosity level of standard output.
π Variables π
enum daemon_log_flags daemon_log_useβ This variable is used to specify the log target(s) to use.const char * daemon_log_identβ Specifies the syslog identification, usedaemon_ident_from_argv0()to set this to a sensible value or generate your own.
π₯ Detailed Description π₯
Contains a robust API for logging messages.
Definition in file dlog.h.
π Macro Definition Documentation π
#define DAEMON_GCC_PRINTF_ATTR(a, b)
A macro for making use of GCCs printf compilation warnings.
Definition at line 59 of file dlog.h.
#define DAEMON_LOGV_AVAILABLE 1
This variable is defined to 1 iff daemon_logv() is supported.
Since
0.11
See also
daemon_logv()
Definition at line 72 of file dlog.h.
#define DAEMON_SET_VERBOSITY_AVAILABLE 1
This variable is defined to 1 iff daemon_set_verbosity() is available.
Since
0.14
See also
daemon_set_verbosity()
Definition at line 92 of file dlog.h.
π Enumeration Type Documentation π
enum daemon_log_flags
Specifies where to send the log messages to. The global variable daemon_log_use takes values of this type.
Enumerator
DAEMON_LOG_SYSLOGβ Log messages are written to syslog.DAEMON_LOG_STDERRβ Log messages are written toSTDERR.DAEMON_LOG_STDOUTβ Log messages are written toSTDOUT.DAEMON_LOG_AUTOβ If this is set adaemon_fork()will change this toDAEMON_LOG_SYSLOGin the daemon process.
Definition at line 38 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 tomain()
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_xxxconstants)t,...β The text message to log
Examples
testd.c.
void daemon_logv (int prio, const char * t, va_list ap)
Same as daemon_log(), but without variadic arguments.
Since
0.11
See also
DAEMON_LOGV_AVAILABLE
void daemon_set_verbosity (int verbosity_prio)
Setter for the verbosity level of standard output.
Parameters
verbosity_prioβ Minimum priority level for messages to output on standard output/error
Allows to decide which messages to output on standard output/error streams. All messages are logged to syslog and this setting does not influence that.
The default value is LOG_WARNING.
Since
0.14
See also
DAEMON_SET_VERBOSITY_AVAILABLE
π Variable Documentation π
const char* daemon_log_ident [extern]
Specifies the syslog identification, use daemon_ident_from_argv0() to set this to a sensible value or generate your own.
Examples
testd.c.
enum daemon_log_flags daemon_log_use [extern]
This variable is used to specify the log target(s) to use. Defaults to DAEMON_LOG_STDERR|DAEMON_LOG_AUTO
π Author π
Generated automatically by Doxygen for libdaemon from the source code.
aaaand that's the whole page bestie π«Ά no notes, we ate. this was libdaemon, Version 0.14, serving you dlog.h(3) realness. go log something, you've got this πβ¨
π¦ where this page comes from
- ubuntu noble: libdaemon-doc 0.14-7.1ubuntu4
- ubuntu questing: libdaemon-doc 0.14-7.1ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms