Metadata-Version: 2.1
Name: mcap-logger
Version: 0.1.18
Summary: provides a standardised, easy to import and use logging method with mcap
Author-email: Kristof Kovacs <kristof.kovacs1996@gmail.com>
License: MIT License
        
        Copyright (c) 2024 bit hunters
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/8-bit-hunters/mcap_logger
Project-URL: Documentation, https://8-bit-hunters.github.io/mcap_logger/
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: foxglove-schemas-protobuf>=0.2.1
Requires-Dist: mcap-protobuf-support>=0.5.1
Requires-Dist: mkdocs-glightbox>=0.4.0

# 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 replacement for standard Python login
- provides console logging with configurable log level and handled separately from the file's

Links:

- [Documentation](https://8-bit-hunters.github.io/mcap_logger/)
- [PyPI package](https://pypi.org/project/mcap-logger/)

## Example usage

### Installing the library

```shell
pip install mcap-logger
```

### Creating a simple log

```python
# Import the library
from mcap_logger.mcap_logger import get_logger

# Get MCAP logger instance
logger = get_logger(__name__)

logger.info("Hello, World!")

```

### Log Protobuf data

> ℹ️ Protocol buffers are Google's language-neutral mechanism for serializing structured data. More info about it and
> its syntax: [Protocol Buffers](https://protobuf.dev/)

```python
# Import the library
from mcap_logger.mcap_logger import get_logger

# Import Protobuf class
from mcap_logger.demo.sensor_data_pb2 import SensorData

# Get MCAP logger instance
logger = get_logger(__name__)

# Log Protobuf data
sensor_message = SensorData(temperature=25, humidity=65)
logger.topic("/sensor_data").write(sensor_message)

```

![](docs/assets/demo_log_in_foxglove.png)

## Call for Contributions

The MCAP-Logger project welcomes your expertise and enthusiasm!
