Skip to main content

Crate v_log

Crate v_log 

Source
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.
MetadataBuilder
Builder for Metadata.
Record
The “payload” of a vlog command.
RecordBuilder
Builder for Record.
SetVLoggerError
The type returned by set_vlogger if set_vlogger has already been called.

Enums§

Color
Basic debugging theme colors.
LineStyle
The style of a line type visual.
PointStyle
The style of a point type visual. There is two distinct types of styles.
TextAlignment
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.