A Python logging library that provides a simple and easy-to-use interface for logging.
Project description
logman
logman is inspired by the SLF4J LoggerFactory from the Spring ecosystem. It aims to provide a similar experience for Python developers, featuring JSON logging and log rotation capabilities.
visit https://logman.wimcorp.dev
Quickstart
- Install logman
$ pip install logman
- Import and use the logger
from logman import LoggerFactory
class MyClass:
def ___init___(self):
self.logger = LoggerFactory.getLogger(self.__class__.__name__)
def my_method(self):
self.logger.info('Hello, World!')
myClass = MyClass()
myClass.my_method()
$ python my_script.py
{"context": "MyClass", "level": "INFO", "timestamp": "2024-07-24 16:25:10.016", "message": "Hello, World!", "thread": "MainThread"}
Run Tests
pytest
pip install pytest
python -m unittest discover -s tests -p 'test_*.py'
tox
pip install tox pytest
tox
Build Docs
Sphinx
pip install Sphinx sphinx-autobuild sphinx-rtd-theme myst_parser
cd docs
make html
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
logman-0.0.3.tar.gz
(7.1 kB
view hashes)
Built Distribution
logman-0.0.3-py3-none-any.whl
(7.9 kB
view hashes)