Module logger

Module logger 

Source
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§

LatencyAggregateMetrics
Used to record Aggregate (min/max/sum) of latency metrics
LevelFilterFromStrError
Error type for [<LevelFilter as FromStr>::from_str].
LoggerConfig
Strongly typed structure used to describe the logger.
LoggerUpdateError
Error type for [Logger::update].
ProcessTimeReporter
Reporter object which computes the process wall time and process CPU time and populates the metric with the results.
SharedIncMetric
Representation of a metric that is expected to be incremented from more than one thread, so more synchronization is necessary.
SharedStoreMetric
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.
LevelFilter
This is required since we originally supported Warning and 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 with log::LevelFilter and only supporting its default deserialization).
MetricsError
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).
StoreMetric
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§

FcLineWriter
Alias for std::io::LineWriter<std::fs::File>.
LoggerInitError
Error type for [Logger::init].