Topic Logger
Topic
Source code in mcap_logger/topic_logger.py
__init__(name, writer)
Initializes Topic entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the topic. |
required |
writer
|
Writer
|
The MCap file writer with protobuf serialization. |
required |
Source code in mcap_logger/topic_logger.py
write(message)
Writes topic with protobuf message to the log file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Any
|
The protobuf message. |
required |
Source code in mcap_logger/topic_logger.py
TopicLogger
A logger class which manages writing data logs to MCAP files.
Not related to logging.Logger.
Source code in mcap_logger/topic_logger.py
__init__(logger_name)
Fetch ProtoBuf writer from the logger's McapHandler.
If the logger doesn't have McapHandler, the data logs won't be written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger_name
|
str
|
The name of the logger to get the McapHandler from. |
required |
Source code in mcap_logger/topic_logger.py
topic(topic_name)
Create a topic for data logging.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic_name
|
str
|
The name of the topic. |
required |
Returns:
| Type | Description |
|---|---|
Topic
|
The created topic. |