Skip to main content

Dead-simple logging: just function composition

Project description

Dslog

Dead-simple logging: just function composition

from dslog import Logger

logger = Logger.of(print) \
  .limit('WARNING') \
  .format(lambda *objs, level, (f'[green][{level}][/]', *objs))

logger('My message', ..., level='INFO')
# doesn't print anything
logger('Oops!', { 'more': 'details' }, level='WARNING')
# [WARNING] Oops! { 'more', 'details' }     ([WARNING] in green)

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

dslog-0.1.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

dslog-0.1.2-py3-none-any.whl (5.7 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