Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (2) — Plan9 4th Edition

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

venti(2)

venti(8)

VENTI-LOG(2)

NAME

VtLog, VtLogChunk, vtlog, vtlogclose, vtlogdump, vtlognames, vtlogopen, vtlogprint, vtlogremove, vtlogopen, ventilogging − Venti logs

SYNOPSIS

#include <u.h>
#include <libc.h>
#include <venti.h>

VtLog∗vtlogopen(char ∗name, uint size);

voidvtlogprint(VtLog ∗log, char ∗fmt, ...);

voidvtlogclose(VtLog ∗log);

voidvtlog(char ∗name, char ∗fmt, ...);

voidvtlogremove(char ∗name);

char∗∗vtlognames(int ∗n);

voidvtlogdump(int fd, VtLog ∗log);

extern int ventilogging;    /∗ default 0 ∗/

extern char ∗VtServerLog;    /∗ "libventi/server" ∗/

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. 

­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 least ­size bytes and returns it.  ­Vtlogclose releases the reference returned by vtlogopen.

­Vtlogprint writes to log, which must be open.

­Vtlog is a convenient packaging of ­vtlogopen followed by ­vtlogprint and vtlogclose.

­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 by calling ­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.) 

­Vtlogdump prints log, which must be open, to the file descriptor fd.

If ­ventilogging is set to zero (the default), ­vtlognames and ­vtlogdump can inspect existing logs, but ­vtlogopen always returns nil and ­vtlog is a no-op.  The other functions are no-ops when passed nil log structures. 

The server library (see venti-conn(2) and venti-server(2)) writes debugging information to the log named VtServerLog, which defaults to the string ‘libventi/server’. 

SOURCE

­/sys/src/libventi

SEE ALSO

venti(2), venti(8)

Plan 9  —  December 02, 2007

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026