MCAP Handler
McapHandler
Bases: Handler
A handler class which writes log messages to MCAP files using ProtoBuf serialization.
Source code in mcap_logger/mcap_handler.py
__init__(file)
Open the specified file and use it as the stream for logging.
If the file already exists, it will be overwritten.
If the parent directory does not exist, it will be created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
Path
|
The MCAP file to store the logs. |
required |
Source code in mcap_logger/mcap_handler.py
close()
emit(record)
Emit a record.
The record will be emitted under the /log
topic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record
|
LogRecord
|
The record to emit into the log file. |
required |