Skip to main content

Logging formatter for fnndsc/pf* family, inspired by pfmisc.debug

Project description

pflogf

PyPI version

Colorful logging formatter for fnndsc/pf* family. Its hardcoded format displays displays time, hostname, and calling function. The various logging levels (debug, info, warn, error, critical) are printed in different colors.

pflogf aims to replace pfmisc/debug.py using the standard Python logging module.

Screenshots

The output is intended for full-screen TTY output.

full screen

It tries to detect when not enough colums are available to display full information.

half screen

Examples

import logging
from pflogf import FnndscLogFormatter

logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
handler.setFormatter(FnndscLogFormatter())
logger.addHandler(handler)

logger.setLevel(logging.DEBUG)
logger.debug('debug me as I am full of bugs')
logger.info('an informative statement')
logger.warning('you\'ll probably ignore this warning')
logger.error('error, problem exists between keyboard and chair')
logger.critical('critical failure, haha jk')

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

pflogf-0.0.3.tar.gz (3.3 kB view hashes)

Uploaded Source

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