Skip to main content

A colored logs package based on 'colored'

Project description

colored_logs Python 3.6

Install

pip install install colored-logs==0.0.2

or

pip3 install install colored-logs==0.0.2

Features

  • Print different types of logs (info, success, warning, error, subtle)
  • Add custom color for each type of log (override defauld values)
  • Mark logs with custom ids (optional, defaults to no id)
  • Show type for every log (optional, defaults to True)
  • Show time of logging for every log (optional, defaults to True)

Usage

from colored_logs.logger import Logger

log = Logger(id='Test-id-1')
log.info('This is an info log')
log.success('This is a success log')
log.warning('This is a warning log')
log.error('This is an error log')
log.subtle('This is a subtle log')

log.set_id('Test-id-2')
log.info('This a log with a new id')

log.set_id('shortened-long_id-2')
log.info('This a log with a long id')

log.set_id(None)
log.info('This a log with no id')

log.set_print_log_type(False)
log.info('This a log with no log type')

log.set_print_time(False)
log.info('This a log with no time')

In action

screenshot

Credit

This package relies on colored, which is maintained by dslackw

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

colored_logs-0.1.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

colored_logs-0.1-py3-none-any.whl (10.8 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