Skip to main content

Prints out a log message to terminal in color

Project description

whylog

This is an library to print color-coded log messages to the terminal. It prints in the following format.

TIME [LOG TYPE] (file names) > (path of the call|line no): Message.

Log Levels

Print or Save to a log file.

Log Level Log Type Print Color Background Color
0 Emergency Black Red
1 Alert Black Yellow
2 Critical Black Magenta
3 Error Red No Color
4 Warning Yellow No Color
5 Notice White Blue
6 Informational White No Color
7 Debug Cyan No Color
8 None NA NA

Usage

Code

from whylog import Log

def main():
    test()

def test():
    log = Log(loglevel=8)
    log.emergency('Test emergency Print by importing')
    log.alert('Test alert Print by importing')
    log.critical('Test crtical Print by importing')
    log.error('Test error Print by importing')
    log.warning('Test warning Print by importing')
    log.notice('Test notice Print by importing')
    log.debug('Test Debug Print by importing')
    log.info('Test info Print by importing')

if __name__ == '__main__':
    main()

Output

Output

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whylog-0.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

whylog-0.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file whylog-0.1.tar.gz.

File metadata

  • Download URL: whylog-0.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for whylog-0.1.tar.gz
Algorithm Hash digest
SHA256 001ffb7750e9b594b823a483e104e48b7dba7c43231df0e3f3d07d75a8474fdc
MD5 2f9c338d54799fe273604161aaec6c3b
BLAKE2b-256 c7342f739010515c7854dab83c7ed8dc31bb93e0c59eda5549edc704b3e39daf

See more details on using hashes here.

Provenance

File details

Details for the file whylog-0.1-py3-none-any.whl.

File metadata

  • Download URL: whylog-0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for whylog-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 edec5994e32b4e70f2d3a90f4b2f0ad02004811dd97428d275eca8f1c4720915
MD5 9fa8079f3f42d62af1cade0c50389aaf
BLAKE2b-256 f32877d6c7e8364a19b7d24d271da5b2d1718141e450aa85089fc49b433571d9

See more details on using hashes here.

Provenance

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