Expand description
Logger Crate that implements Firecracker specific functionality as far as logging and metrics collecting.
Macros§
- debug
- Logs a message at the debug level.
- error
- Logs a message at the error level.
- info
- Logs a message at the info level.
- log_
enabled - Determines if a message logged at the specified level in that module will be logged.
- trace
- Logs a message at the trace level.
- warn
- Logs a message at the warn level.
Structs§
- Latency
Aggregate Metrics - Used to record Aggregate (min/max/sum) of latency metrics
- Level
Filter From StrError - Error type for [
<LevelFilter as FromStr>::from_str]. - Logger
Config - Strongly typed structure used to describe the logger.
- Logger
Update Error - Error type for [
Logger::update]. - Process
Time Reporter - Reporter object which computes the process wall time and process CPU time and populates the metric with the results.
- Shared
IncMetric - Representation of a metric that is expected to be incremented from more than one thread, so more synchronization is necessary.
- Shared
Store Metric - Representation of a metric that is expected to hold a value that can be accessed from more than one thread, so more synchronization is necessary.
Enums§
- Level
- An enum representing the available verbosity levels of the logger.
- Level
Filter - This is required since we originally supported
Warningand uppercase variants being used as the log level filter. It would be a breaking change to no longer support this. In the next breaking release this should be removed (replaced withlog::LevelFilterand only supporting its default deserialization). - Metrics
Error - Describes the errors which may occur while handling metrics scenarios.
Constants§
- DEFAULT_
INSTANCE_ ID - Default instance id.
- DEFAULT_
LEVEL - Default level filter for logger matching the swagger specification
(
src/firecracker/swagger/firecracker.yaml).
Statics§
- INSTANCE_
ID - Instance id.
- LOGGER
- The logger.
- METRICS
- Static instance used for handling metrics.
Traits§
- IncMetric
- Used for defining new types of metrics that act as a counter (i.e they are continuously updated by incrementing their value).
- Store
Metric - Used for defining new types of metrics that do not need a counter and act as a persistent indicator.
Functions§
- log_
dev_ preview_ warning - Log a standard warning message indicating a given feature name is in development preview.
- update_
metric_ with_ elapsed_ time - Helper function for updating the value of a store metric with elapsed time since some time in a past.
Type Aliases§
- FcLine
Writer - Alias for
std::io::LineWriter<std::fs::File>. - Logger
Init Error - Error type for [
Logger::init].