provides a standardised, easy to import and use logging method with mcap
Project description
MCAP Logger 🧢
Project description
This python package to provide a standardised, easy to import and use logging method.
The package is...
- a logger module that leverages the existing MCAP and Foxglove packages
- provides a plugin for standard Python loging
Links:
Example usage
Installing the library
pip install mcap-logger
Creating a simple log
import logging
from pathlib import Path
from mcap_logger.mcap_handler import McapHandler
def main(): # noqa: ANN201
log_file = Path("hello.mcap")
mcap_handler = McapHandler(log_file)
mcap_handler.setLevel("DEBUG")
logger = logging.getLogger("mcap_logger")
logger.addHandler(mcap_handler)
logger.setLevel("DEBUG")
logger.info("Hello from mcap-logger-tutorial!")
Log Protobuf data
ℹ️ Protocol buffers are Google's language-neutral mechanism for serializing structured data. More info about it and its syntax: Protocol Buffers
from sensor_data_pb2 import SensorData
from mcap_logger.topic_logger import TopicLogger
log_file = Path("hello.mcap")
mcap_handler = McapHandler(log_file)
mcap_handler.setLevel("DEBUG")
logger = logging.getLogger("mcap_logger")
logger.addHandler(mcap_handler)
logger.setLevel("DEBUG")
# Log Protobuf data
sensor_message = SensorData(temperature=25, humidity=65)
TopicLogger("mcap_logger").topic("/sensor_data").write(sensor_message)
Call for Contributions
The MCAP-Logger project welcomes your expertise and enthusiasm!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcap_logger-1.0.0.tar.gz.
File metadata
- Download URL: mcap_logger-1.0.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b87c78b55d4ccebcce3e33441410af2688cd66a0a448d645ab5d9f5c64822c0
|
|
| MD5 |
7685731a36b472022d5b423fb153a94a
|
|
| BLAKE2b-256 |
a5d17880dc63390096d3e4eced8e7a7a5be0ec9810b69005ad863ec9eeea151f
|
Provenance
The following attestation bundles were made for mcap_logger-1.0.0.tar.gz:
Publisher:
release.yml on 8-bit-hunters/mcap_logger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcap_logger-1.0.0.tar.gz -
Subject digest:
4b87c78b55d4ccebcce3e33441410af2688cd66a0a448d645ab5d9f5c64822c0 - Sigstore transparency entry: 151039510
- Sigstore integration time:
-
Permalink:
8-bit-hunters/mcap_logger@ecd70187fb40776f8985a5318357b6792ea6bb0b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/8-bit-hunters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ecd70187fb40776f8985a5318357b6792ea6bb0b -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcap_logger-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcap_logger-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d8f11315e51a187b1daf6aa33ae57c7dbe157fa1c7e64432e81e25759279869
|
|
| MD5 |
17878b97876a69f7c827ebe5e79bfad7
|
|
| BLAKE2b-256 |
ed9eb5c4f078057d7eca7c98683553e7c485bd5ff618684e2674ad02be89426c
|
Provenance
The following attestation bundles were made for mcap_logger-1.0.0-py3-none-any.whl:
Publisher:
release.yml on 8-bit-hunters/mcap_logger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcap_logger-1.0.0-py3-none-any.whl -
Subject digest:
2d8f11315e51a187b1daf6aa33ae57c7dbe157fa1c7e64432e81e25759279869 - Sigstore transparency entry: 151039512
- Sigstore integration time:
-
Permalink:
8-bit-hunters/mcap_logger@ecd70187fb40776f8985a5318357b6792ea6bb0b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/8-bit-hunters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ecd70187fb40776f8985a5318357b6792ea6bb0b -
Trigger Event:
push
-
Statement type: