Skip to main content

Crate gwr_track

Crate gwr_track 

Source
Expand description

This module provides combined track capabilities for the GWR project.

Track means the combination of log and trace where:

  • log are text-based human-readable messages emitted at various levels of verbosity (from Trace through to Error).
  • trace provides a standard set of modelling events that can be emitted. For example, object creation/destruction or objects entering/exitting simulation Entities.

The track events can be emitted using:

  • a textual output based on the log crate.
  • a packed binary output based on Cap’n Proto.
  • a packed binary output based output based on Perfetto TrackEvents Protobufs (only avaliable with the perfetto feature enabled).

Re-exports§

pub use tracker::Track;
pub use tracker::Tracker;
pub use id::Id;

Modules§

builder
Library functions to build trackers as defined by the user.
entity
A simulation entity.
gwr_track_capnp
Auto-generated Cap’n Proto module
id
Id
perfetto_trace_builder
Support for generating Perfetto traces.
test_helpers
This module provides helper functions for testing logging output
trace_visitor
This module provides helper functions for dealing with Cap’n Proto binary data.
tracker
Include the trackers. Define the Track trait a number of Trackers.

Macros§

build_aka
Helper function for creating local Aka derived from incoming Aka
connect
Connect two entities
create_id
Create a unique ID for tracking.
debug
The debug macro provides a wrapper for the log macro at level log::Level::Debug
destroy
Add an entity destroy event
destroy_id
Destroy an ID
error
the error macro provides a wrapper for the log macro at level log::Level::Error
info
The info macro provides a wrapper for the log macro at level log::Level::Info
log_base
Base macro for log messages of all level.
set_time
Update the current time.
test_init
Initialise the logging system for tests
trace
The trace macro provides a wrapper for the log macro at level log::Level::Trace
track_create_object
Add an object creation event.
warn
The warn macro provides a wrapper for the log macro at level log::Level::Info

Constants§

NO_ID
ID value which indicates where there is no valid ID
ROOT
The root ID from which all other IDs are derived

Functions§

str_to_level
Take the command-line string and convert it to a Level

Type Aliases§

Writer
A type alias for objects that receive log / trace events.