From: Martin Mares Date: Fri, 13 Feb 2009 23:16:42 +0000 (+0100) Subject: Logging: Improved documentation of struct log_stream. X-Git-Tag: holmes-import~92 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=2ce5075773f3f60ef78ab8191ace071f7a4e4d66;p=libucw.git Logging: Improved documentation of struct log_stream. --- diff --git a/ucw/log.h b/ucw/log.h index dcef4ae9..1a3bdf50 100644 --- a/ucw/log.h +++ b/ucw/log.h @@ -20,8 +20,8 @@ struct log_msg { char *m; // The formatted message itself, ending with \n\0 int m_len; // Length without the \0 - struct tm *tm; - uns flags; + struct tm *tm; // Current time + uns flags; // Category and other flags as passed to msg() char *raw_msg; // Unformatted parts char *stime; char *sutime; @@ -29,26 +29,17 @@ struct log_msg struct log_stream { - /* optional name, 0-term, de/allocated by constr./destr. or user */ - char *name; - /* number for use with msg parameter (from LS_SET_STRNUM()), -1 for closed log_stream */ - int regnum; - /* arbitrary data for filter/handler */ - int idata; + char *name; // Optional name, allocated by the user (or constructor) + int regnum; // Stream number, already encoded by LS_SET_STRNUM(); -1 if closed + uns levels; // Bitmask of accepted severity levels + uns msgfmt; // Formatting flags (LSFMT_xxx) + int (*filter)(struct log_stream* ls, struct log_msg *m); // Filter function, return non-zero to discard the message + struct clist substreams; // Pass the message to these streams (simple_list of pointers) + int (*handler)(struct log_stream *ls, struct log_msg *m); // Called to commit the message + void (*close)(struct log_stream* ls); // Called on log_close_stream() + int idata; // Private data of the handler void *pdata; uns udata; - /* severity levels to accept - bitmask of (1<