libu8
Functions
include/libu8/u8logging.h File Reference

These functions provide various ways of logging program events. More...

Functions

U8_EXPORT int u8_logger (int priority, u8_condition c, u8_string message)
 Possibly generates a log message for an (optional) condition.
U8_EXPORT int u8_log (int priority, u8_condition c, u8_string format_string,...)
 Possibly formats a log message for an (optional) condition.
U8_EXPORT u8_string u8_message_prefix (u8_byte *buf, int buflen)
 Generates a message prefix into the given buffer, with output including process information controlled by the various u8_log_show variables.
U8_EXPORT void u8_syslog (int priority, u8_string format_string,...)
 Formats and outputs a string using syslog and the given priority level.
U8_EXPORT void u8_use_syslog (int flag)
 Control whether syslog is used together with stdio output.

Detailed Description

These functions provide various ways of logging program events.


Function Documentation

U8_EXPORT int u8_log ( int  priority,
u8_condition  c,
u8_string  format_string,
  ... 
)

Possibly formats a log message for an (optional) condition.

Whether and where this produces output depends on how the program is linked and configured.

Parameters:
priorityan (int [-1,7]) priority level
ca string describing the condition (possibly NULL)
format_stringa utf-8 printf-like format string
...arguments for the format string
Returns:
1 if the call actually produced output somewhere
U8_EXPORT int u8_logger ( int  priority,
u8_condition  c,
u8_string  message 
)

Possibly generates a log message for an (optional) condition.

Whether and where this produces output depends on how the program is linked and configured.

Parameters:
priorityan (int [-1,7]) priority level
ca string describing the condition (possibly NULL)
messagethe content of the message to be emmited
Returns:
1 if the call actually produced output somewhere
U8_EXPORT u8_string u8_message_prefix ( u8_byte *  buf,
int  buflen 
)

Generates a message prefix into the given buffer, with output including process information controlled by the various u8_log_show variables.

If buflen doesn't allow all the information to be shown, some information may be removed.

Parameters:
bufa byte buffer in which to compose the prefix
buflenthe number of bytes in the buffer
Returns:
a pointer to the buffer it was given, filled with context information and null terminated.
U8_EXPORT void u8_syslog ( int  priority,
u8_string  format_string,
  ... 
)

Formats and outputs a string using syslog and the given priority level.

This does its output if u8_loglevel is greater than 0.

Parameters:
priorityan (int) priority level passed to syslog
format_stringa utf-8 printf-like format string
...arguments for the format string
Returns:
void
U8_EXPORT void u8_use_syslog ( int  flag)

Control whether syslog is used together with stdio output.

If flag is 1, syslog is used for notifications and warnings, together with the stderr.

Parameters:
flagint