Skip to main content

Package to log styled messages on console

Project description

clinlog

PyPI version PyPI version

Package to easily log styled messages on console using colorama


Basic usage

Create a Logger object and use his convenient methods to print styled messages in console. You can define a default tag for each kind of message on the Logger instance.

Print style methods

  • print_error()
  • print_warn()
  • print_info()
  • print_confirm()
  • print_norm()

The signature for all print methods are the same:

  1. message (str): Message to print.
  2. tag (str): (Optional) Prefix to print with the message. If None the default tag for this kind of messages is used. An empty string will remove the tag for this print.
  3. bold (bool): (Optional) True to use bright style to print the message (kind of bold font). By default False.
  4. highlight (bool): True to use the color on the background and a high contrast color for the message text.
  5. invert_color (bool): True to invert font color when highlight flag is on, this will switch between black and white. By default False.

Default print tag attributes

  • error_tag
  • warn_tag
  • info_tag
  • confirm_tag
  • norm_tag

Code Sample

from clinlog import Logger

# Create the logger
log = Logger()

# Set default error tag
log.error_tag = '[ERROR]: '

# Print error styled message
log.print_error('Unable to access config file', bold=True)

# Print warning highlighted and bold
log.print_warn('The execution will continue with default configuration', None, True, True)

# Confirmation log with provided tag
log.print_confirm('Execution completed', '[SUCCESS]')

Output

tree_output

Different styes sample

tree_output

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

clinlog-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

clinlog-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file clinlog-0.1.0.tar.gz.

File metadata

  • Download URL: clinlog-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for clinlog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 701fcd3ebf21caf69aa1bc11832886524b7d002b27b97517bf56fb6455f109a3
MD5 e3280ef3cd40077a1c6ef8f6710ab5ff
BLAKE2b-256 077512c58c14e745c529e935d51649ece329852354d4fac24f0ed8e7dc391f30

See more details on using hashes here.

File details

Details for the file clinlog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clinlog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for clinlog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29b5eccff05b066ca423b61d668c884d00487f5695131f34cad5740e1cc2b806
MD5 58861b47aa64097a0d67f5a9e3faa78e
BLAKE2b-256 f81ff08c4d2d7ab09bd93186eb219a85f93644f45597ca185e2c991f6634c855

See more details on using hashes here.

Supported by

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