]> mj.ucw.cz Git - libucw.git/commit
Logging: Introduce inheritance of log_stream's.
authorMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2009 23:59:36 +0000 (00:59 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2009 23:59:36 +0000 (00:59 +0100)
commit96d356a371d711395e0a39b62f8ac785739366dd
tree96c66e0ed18cc2fbbb4d956c249c645d9cc91cf9
parent64ebae182951545e635fb27cac324909a8b34e9e
Logging: Introduce inheritance of log_stream's.

The outbreak of various private fields (idata, pdata, udata) in struct log_stream
has gotten somewhat ugly, so I have replaced them by real private data allocated
after the standard portion of the log_stream structure.

log_new_stream() has gained a parameter telling it the size of the structure
to allocate. I have kept the recycler for the time being -- while saving allocations
is not worth the effort, it still nicely keeps the list of free stream ID's.

As idata are gone, the list of free items is now chained by log_stream->levels.

The default log stream no longer stores the fd explicitly, both log-file and
log-syslog keep private data in their own data structure extending log_stream.
ucw/log-file.c
ucw/log-stream.c
ucw/log-syslog.c
ucw/log.c
ucw/log.h