Static class providing logging functionality with configurable targets.
More...
#include <ircbot/log.h>
Static class providing logging functionality with configurable targets.
◆ IBLog_fmt()
| void IBLog_fmt |
( |
IBLogLevel |
level, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Log a message, using printf-like formatting.
- Parameters
-
| level | the log level |
| format | the format string |
| ... | the arguments for conversions in the format string |
◆ IBLog_msg()
| void IBLog_msg |
( |
IBLogLevel |
level, |
|
|
const char * |
message |
|
) |
| |
Log a message.
- Parameters
-
| level | the log level |
| message | the message |
◆ IBLog_setAsync()
| void IBLog_setAsync |
( |
int |
async | ) |
|
Enable async logging.
If this is set, logging will attempt to offload calling the log writer to the internal thread pool. This is recommended for any log writer that could block. IrcBot_run() will automatically set this if daemonizing was requested. Default: 0
- Parameters
-
| async | 1 to enable async logging, 0 to disable |
◆ IBLog_setCustomLogger()
| void IBLog_setCustomLogger |
( |
IBLogWriter |
writer, |
|
|
void * |
data |
|
) |
| |
Set a custom log writer.
- Parameters
-
| writer | the log writer |
| data | optional context for the writer |
◆ IBLog_setFileLogger()
| void IBLog_setFileLogger |
( |
FILE * |
file | ) |
|
Set a log writer logging to the specified file handle.
- Parameters
-
| file | the file handle to write to |
◆ IBLog_setMaxLogLevel()
Set the maximum level for logging.
Default: L_INFO.
- Parameters
-
◆ IBLog_setSilent()
| void IBLog_setSilent |
( |
int |
silent | ) |
|
Silence all logging.
This is meant to temporarily disable any logging except L_FATAL, for cases when some errors are expected and should be suppressed.
- Parameters
-
| silent | 1 to enable silent mode, 0 to disable |
◆ IBLog_setSyslogLogger()
| void IBLog_setSyslogLogger |
( |
const char * |
ident, |
|
|
int |
facility, |
|
|
int |
withStderr |
|
) |
| |
Set a log writer logging via syslog().
- Parameters
-
| ident | identification of the logger |
| facility | syslog facility to use, see <syslog.h> |
| withStderr | if non-zero, also log to stderr |
The documentation for this class was generated from the following file: