2 * log.h - Simple logging framework.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2003 Project Purple
13 * loglevels - levels of severity for a log entry
15 * These provide various different levels of severity for a log entry. In
16 * acesending order they are:
26 * By default the log threshold is set to LOGTHING_NOTICE, meaning
27 * anything with a lower priority won't be output.
40 * initlogthing - initialize the logging module
41 * @appname: The application name to use in the log.
42 * @filename: The filename to log to. NULL means stderr.
44 * This function sets up the logging module ready to log. The appname is
45 * written as part of every log entry and the filename is the file we
46 * should log to. If the appname is NULL then none is written. If the
47 * filename is NULL all output is sent to stderr.
49 int initlogthing(const char *appname, const char *filename);
52 * cleanuplogthing - clean up the logging module
54 * This function cleans up the logging module after use.
56 void cleanuplogthing(void);
59 * setlogthreshold - set the threshold for log output
60 * @loglevel: The minimum log level we should output
62 * Sets the threshold for log output; anything logged with a log level
63 * lower than this will be silently dropped. Returns the old log threshold
66 loglevels setlogthreshold(loglevels loglevel);
69 * logthing - output a log entry
70 * @loglevel: The level of the log.
71 * @format: A format string, followed by any parameters required.
73 * This function outputs a log entry. A leading time/date stamp and a
74 * trailing newline are automatically added. The loglevel is compared to
75 * the current log threshold and if equal or above the log entry is
76 * output. The format parameter is of the same nature as that used in
79 int logthing(loglevels loglevel, const char *format, ...);
81 #endif /* __LOG_H__ */