LIBIRCCD-LOG(3) - Library Functions Manual
libirccd-log - loggers
#include <irccd/log.h>
void
irc_log_to_syslog(void);
void
irc_log_to_console(void);
void
irc_log_to_file(const char *path);
void
irc_log_to_null(void);
void
irc_log_set_verbose(int verbose);
void
irc_log_set_template(const char *tmpl);
void
irc_log_info(const char *fmt, …);
void
irc_log_warn(const char *fmt, …);
void
irc_log_debug(const char *fmt, …);
void
irc_log_finish(void);
This header provides functions to log messages into the configured irccd(1) loggers.
Messages should always be prefixed by its component. For example, server messages start with “server <id>:” and plugins “plugin <id>:”.
The irc_log_to_syslog(), irc_log_to_console() and irc_log_to_null() set the logger to the syslog(3) mechanism, standard output/error and completely quiet respectively. The irc_log_to_file() uses the file specified by path to log everything. All those functions will close the current adapter before changing it.
The irc_log_set_verbose() changes the verbosity to on if verbose is greater than 0 (which is the default).
The irc_log_set_template() changes the format string used to log entries with the help of libirccd-subst(3) routines. Passing NULL as tmpl resets the default format to “#{message}”
The irc_log_info() uses the printf(3) like format to log information messages. Thoses messages are ignored if the verbosity is null.
The irc_log_warn() function logs a warning message, it is always written even if verbosity is null.
The irc_log_debug() only write messages if the daemon was built in “debug” mode, it also ignores the verbosity level.
The irc_log_finish() function closes the current adapter. It is usually not required from the user itself.
libirccd(3)
The irccd daemon was written by David Demelier <markand@malikania.fr>.
macOS 13.5 - February 3, 2022