VENTI-LOG(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

✨ NAME ✨

okay bestie, welcome to VENTI-LOG(3) from the Library Functions Manual πŸ’– this is the Venti logs page, and the whole squad is: VtLog, VtLogChunk, vtlog, vtlogclose, vtlogdump, vtlognames, vtlogopen, vtlogprint, vtlogremove, vtlogopen, ventilogging β€” literally all about Venti logs πŸŽ€


🌸 SYNOPSIS 🌸

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

       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);

       char** vtlognames(int *n);

       void   vtlogdump(int fd, VtLog *log);

       extern int ventilogging;    /* default 0 */

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

πŸ’– DESCRIPTION πŸ’–

okay so these routines give you an in-memory circular log structure β€” the Venti library and the Venti server use it to record events for debugging purposes. The logs are named by UTF strings ✨ lowkey iconic.

  • 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 β€” 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.) ⚠️ no cap, that last bit matters.
  • 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(3) and venti-server(3)) writes debugging information to the log named VtServerLog, which defaults to the string libventi/server 🌈


πŸŽ€ SOURCE πŸŽ€

/src/libventi


πŸ¦‹ SEE ALSO πŸ¦‹

venti(3), venti(8)


mwah πŸ’‹ β€” this was VENTI-LOG(3) from the Library Functions Manual, source at /src/libventi, footer tag VENTI-LOG(3) and no date shown here, bestie. bye! 🫢✨