groff 1.23.0 added .MR to its -man macro package. The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020." From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.
Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.
Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized. groff's .MR does not. This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
137 lines
2.3 KiB
Groff
137 lines
2.3 KiB
Groff
.TH VENTI-LOG 3
|
|
.SH NAME
|
|
VtLog,
|
|
VtLogChunk,
|
|
vtlog,
|
|
vtlogclose,
|
|
vtlogdump,
|
|
vtlognames,
|
|
vtlogopen,
|
|
vtlogprint,
|
|
vtlogremove,
|
|
vtlogopen,
|
|
ventilogging \- Venti logs
|
|
.SH SYNOPSIS
|
|
.ft L
|
|
#include <u.h>
|
|
.br
|
|
#include <libc.h>
|
|
.br
|
|
#include <venti.h>
|
|
.ta +\w'\fLVtLog* 'u
|
|
.PP
|
|
.B
|
|
VtLog* vtlogopen(char *name, uint size);
|
|
.PP
|
|
.B
|
|
void vtlogprint(VtLog *log, char *fmt, ...);
|
|
.PP
|
|
.B
|
|
void vtlogclose(VtLog *log);
|
|
.PP
|
|
.B
|
|
void vtlog(char *name, char *fmt, ...);
|
|
.PP
|
|
.B
|
|
void vtlogremove(char *name);
|
|
.PP
|
|
.B
|
|
char** vtlognames(int *n);
|
|
.PP
|
|
.B
|
|
void vtlogdump(int fd, VtLog *log);
|
|
.PP
|
|
.B
|
|
extern int ventilogging; /* default 0 */
|
|
.PP
|
|
.B
|
|
extern char *VtServerLog; /* "libventi/server" */
|
|
.SH DESCRIPTION
|
|
These routines provide an in-memory circular log
|
|
structure used by the Venti library and the Venti server
|
|
to record events for debugging purposes.
|
|
The logs are named by UTF strings.
|
|
.PP
|
|
.I Vtlogopen
|
|
returns a reference to the log with the given
|
|
.I name .
|
|
If a log with that name does not exist and
|
|
.I size
|
|
is non-zero,
|
|
.I vtlogopen
|
|
creates a new log capable of holding at
|
|
least
|
|
.I size
|
|
bytes and returns it.
|
|
.I Vtlogclose
|
|
releases the reference returned by
|
|
.IR vtlogopen .
|
|
.PP
|
|
.I Vtlogprint
|
|
writes to
|
|
.IR log ,
|
|
which must be open.
|
|
.PP
|
|
.I Vtlog
|
|
is a convenient packaging of
|
|
.I vtlogopen
|
|
followed by
|
|
.I vtlogprint
|
|
and
|
|
.IR vtlogclose .
|
|
.PP
|
|
.I Vtlogremove
|
|
removes the log with the given
|
|
.IR name ,
|
|
freeing any associated storage.
|
|
.PP
|
|
.I Vtlognames
|
|
returns a list of the names of all the logs.
|
|
The length of the list is returned in
|
|
.BI * n \fR.
|
|
The list
|
|
should be freed
|
|
by calling
|
|
.I vtfree
|
|
on the returned pointer.
|
|
The strings in the list will be freed by this call as well.
|
|
(It is an error to call
|
|
.I vtfree
|
|
on any of the strings in the list.)
|
|
.PP
|
|
.I Vtlogdump
|
|
prints
|
|
.IR log ,
|
|
which must be open, to the file descriptor
|
|
.IR fd .
|
|
.PP
|
|
If
|
|
.I ventilogging
|
|
is set to zero (the default),
|
|
.I vtlognames
|
|
and
|
|
.I vtlogdump
|
|
can inspect existing logs, but
|
|
.I vtlogopen
|
|
always returns nil
|
|
and
|
|
.I vtlog
|
|
is a no-op.
|
|
The other functions are no-ops when
|
|
passed nil log structures.
|
|
.PP
|
|
The server library
|
|
(see
|
|
.MR venti-conn 3
|
|
and
|
|
.MR venti-server 3 )
|
|
writes debugging information to the log named
|
|
.IR VtServerLog ,
|
|
which defaults to the string
|
|
.RB ` libventi/server '.
|
|
.SH SOURCE
|
|
.B \*9/src/libventi
|
|
.SH SEE ALSO
|
|
.MR venti 3 ,
|
|
.MR venti 8
|