VtLog*vtlogopen(char *name, uint size);
void vtlogprint(VtLog *log, char *fmt, ...);
void vtlogclose(VtLog *log);
void vtlog(char *name, char *fmt, ...);
void vtlogremove(char *name);
void vtlogdump(int fd, VtLog *log);
extern int ventilogging; /* default 0 */
extern char *VtServerLog; /* "libventi/server" */
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.
Vtlogopen returns a reference to the log with the given
name . If a log with that name does not exist and
size is non-zero,
vtlogopen creates a new log capable of holding at
size bytes and returns it.
Vtlogclose releases the reference returned by
Vtlogprint writes to
log, which must be open.
Vtlog is a convenient packaging of
vtlogopen followed by
Vtlogremove removes the log with the given
name, freeing any associated storage.
Vtlognames returns a list of the names of all the logs.
The length of the list is returned in
*n. The list
should be freed
vtfree on the returned pointer.
The strings in the list will be freed by this call as well.
(It is an error to call
vtfree on any of the strings in the list.)
log, which must be open, to the file descriptor
ventilogging is set to zero (the default),
vtlogdump can inspect existing logs, but
vtlogopen always returns nil
vtlog is a no-op.
The other functions are no-ops when
passed nil log structures.
The server library
writes debugging information to the log named
VtServerLog, which defaults to the string