Skip to main content

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

  1. Install logman
$ pip install logman
  1. 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


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)

Uploaded Source

Built Distribution

logman-0.0.3-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page