Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacebrowning/minilog
Minimalistic wrapper for Python logging.
https://github.com/jacebrowning/minilog
logging python
Last synced: 4 days ago
JSON representation
Minimalistic wrapper for Python logging.
- Host: GitHub
- URL: https://github.com/jacebrowning/minilog
- Owner: jacebrowning
- License: mit
- Created: 2018-03-02T18:43:01.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-08-24T14:29:55.000Z (5 months ago)
- Last Synced: 2025-01-21T14:09:47.573Z (12 days ago)
- Topics: logging, python
- Language: Python
- Homepage: https://minilog.readthedocs.io
- Size: 712 KB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# minilog
A minimalistic logging wrapper for Python.
[![Linux Build](https://img.shields.io/github/actions/workflow/status/jacebrowning/minilog/main.yml?branch=main&label=linux)](https://github.com/jacebrowning/minilog/actions)
[![Windows Build](https://img.shields.io/appveyor/ci/jacebrowning/minilog/main.svg?label=windows)](https://ci.appveyor.com/project/jacebrowning/minilog)
[![Code Coverage](https://img.shields.io/codecov/c/github/jacebrowning/minilog)](https://codecov.io/gh/jacebrowning/minilog)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/jacebrowning/minilog.svg)](https://scrutinizer-ci.com/g/jacebrowning/minilog)
[![PyPI License](https://img.shields.io/pypi/l/minilog.svg)](https://pypi.org/project/minilog)
[![PyPI Version](https://img.shields.io/pypi/v/minilog.svg)](https://pypi.org/project/minilog)
[![PyPI Downloads](https://img.shields.io/pypi/dm/minilog.svg?color=orange)](https://pypistats.org/packages/minilog)## Usage
Every project should utilize logging, but for simple use cases, this requires a bit too much boilerplate. Instead of including all of this in your modules:
```python
import logginglog = logging.getLogger(__name__)
def greet(name):
log.info("Hello, %s!", name)if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
format="%(levelname)s: %(name)s: %(message)s",
)
```with this package you can simply:
```python
import logdef greet(name):
log.info("Hello, %s!", name)if __name__ == "__main__":
log.init()
```It will produce the exact same standard library `logging` records behind the scenes with automatic formatting for non-strings.
## Installation
Install this library directly into an activated virtual environment:
```text
$ pip install minilog
```or add it to your [Poetry](https://poetry.eustace.io/) project:
```text
$ poetry add minilog
```## Documentation
To view additional options, please consult the [full documentation](https://minilog.readthedocs.io/en/latest/logging/).