Expand description
A lightweight visual vlogging/debugging facade. Useful for geometry applications.
The v-log crate provides a single vlogging API that abstracts over the
actual vlogging implementation. Libraries can use the vlogging API provided
by this crate, and the consumer of those libraries can choose the vlogging
implementation that is most suitable for its use case.
If no vlogging implementation is selected, the facade falls back to a “noop” implementation, which has very little overhead.
A vlog request consists of a target, a surface, and a visual. A target is a string which defaults to the module path of the location of the vlog request, though that default may be overridden. Vlogger implementations typically use the target to filter requests based on some user configuration. A surface is a space or context in which the drawing is done. Vlogger implementations may choose different ways to represent them, but any named surface must be either filtered out or displayed by the implementation. There is no global “main-surface”, as drawing surfaces/spaces are created on demand. One can think of these as plot figures or desktop windows.
§Usage
The basic use of the vlog crate is through the vlogging macros:
point!, polyline!, message!, label!, clear!.
They form the basic building blocks of drawing.
Macros§
- clear
- Clear a surface of the vlogger, including the messages that have been sent to it.
- label
- Sends a label/text annotation to the vlogger.
- message
- Logs a message to the vlogger.
- point
- Sends a point to the vlogger.
- polyline
- Sends an open or closed polyline to the vlogger.
- vlog_
enabled - Determines if a message vlogged at the specified level in that module will be vlogged.
Structs§
- Metadata
- Metadata about a vlog command.
- Metadata
Builder - Builder for
Metadata. - Record
- The “payload” of a vlog command.
- Record
Builder - Builder for
Record. - SetV
Logger Error - The type returned by
set_vloggerifset_vloggerhas already been called.
Enums§
- Color
- Basic debugging theme colors.
- Line
Style - The style of a line type visual.
- Point
Style - The style of a point type visual. There is two distinct types of styles.
- Text
Alignment - The text alignment relative to a specified spacepoint. All variants center the text vertically.
- Visual
- A visual element to be drawn by the vlogger.
Traits§
- VLog
- A trait encapsulating the operations required of a vlogger.
Functions§
- set_
boxed_ vlogger - Sets the global vlogger to a
Box<VLog>. - set_
vlogger - Sets the global vlogger to a
&'static VLog. - set_
vlogger_ ⚠racy - A thread-unsafe version of
set_vlogger. - vlogger
- Returns a reference to the vlogger.