chiark / gitweb /
log: Introduce slilog_part; abolish log_if->logfn
[v]Message provides a facility for sending messages to the system log
which are assembled out of pieces. This is quite useful. Generalise
it to other logger interfaces too:
* Move the functionality out of vMessage into a new function
vslilog_part. Provide slilog_part too.
* Move the assembly buffer: it was a static variable (used only
for the system log); now it is a member of the log_if. (Yes,
the log_if, not the private state, because it applies for all
loggers and is used by common code ie vslilog_part.)
* Initialise log_if->buff[0] everywhere.
* Rename LOG_MESSAGE_BUFLEN from MESSAGE_BUFLEN since now it
has to live in secnet.h.
Also, remove log_if->logfn. All the call sites use vlogfn. Doing
this in this patch makes it easy to see that we haven't missed any
places where we should be initialising log_if->buff[0].
We currently have -Wunused ie -Wunused-functions, so for now we leave
the pointless definitions of the various loggers' logfns.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>