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
- 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"}
pip install pytest
python -m unittest discover -s tests -p 'test_*.py'
pip install -r requirements-test.txt
tox
pip install -r requirements-docs.txt
make -C docs html
# Output path: docs/_build/html