v-log 0.3.0

A lightweight visual logging/debugging facade for Rust
Documentation
  • Coverage
  • 100%
    120 out of 120 items documented17 out of 68 items with examples
  • Size
  • Source code size: 86.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.13 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • redweasel/v-log
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • redweasel

v-log

A Rust library providing a lightweight visual logging/debugging facade.

Build status Latest version Documentation License

A visual logging facade provides a single visual logging API that abstracts over the actual visual logging implementation. Libraries can use the visual logging API provided by this crate, and the consumer of those libraries can choose the visual logging implementation that is most suitable for its use case.

Minimum supported rustc

1.68.0+

This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.

Usage

In libraries

Libraries should link only to the v-log crate, and use the provided macros to log whatever geometric information will be useful to downstream consumers:

[dependencies]
v-log = "0.3"
use v_log::{line, label};

pub fn shave_the_yak(yak: &mut Yak) {
    label!("yak_surface", [10.0, 10.0], (12.0, Warn, "<"), "Commencing yak shaving!");

    for (&pos1, &pos2) in &yak.lines {
        polyline!("yak_surface", (pos1, pos2), 2.0, Base);
    }
}

In executables

In order to produce log output, executables have to use a vlogger implementation compatible with the facade. Currently the following implementations exist:

Executables should choose a vlogger implementation and initialize it early in the runtime of the program. Vlogger implementations will typically include a function to do this. Any v-log messages generated before the vlogger is initialized will be ignored.

The executable itself may use the v-log crate to log geometry as well.