Dead-simple logging: what python's logging should've been
Project description
Dead Simple Logging
What python's
logging
should've been
Installation
pip install dslog
Usage
- Any custom "handler" (aka function to actually print)
import rich
from dslog import Logger
logger = Logger.of(rich.print) \
.limit('WARNING') \
.format(lambda *objs, level: (f'[bold][{level}][/]', *objs))
logger('My message', ..., level='INFO')
# doesn't print anything
logger('Oops!', { 'more': 'details' }, level='WARNING')
# [WARNING] Oops! { 'more', 'details' } ([WARNING] in bold text)
- Or some of the predefined ones, which come already formatted
Logger.rich()
Logger.file('log.txt')
- Or the best default logger
Logger.empty()
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
dslog-0.1.5.tar.gz
(4.4 kB
view hashes)
Built Distribution
dslog-0.1.5-py3-none-any.whl
(5.9 kB
view hashes)