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


Download files

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

Source Distribution

whyylog-0.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

whyylog-0.2-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file whyylog-0.2.tar.gz.

File metadata

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

File hashes

Hashes for whyylog-0.2.tar.gz
Algorithm Hash digest
SHA256 0de4ccbbe65e32dfeb28c5c719ce04a1d0e7d5180554b2ba902f708bd5dac860
MD5 d93de61d1092620de2c400dbc0d3adad
BLAKE2b-256 ba426dfb9faf5d50c6dc135e1c1f2f15e8dac4cffbcd38d407b138adca15de85

See more details on using hashes here.

File details

Details for the file whyylog-0.2-py3-none-any.whl.

File metadata

  • Download URL: whyylog-0.2-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 whyylog-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7876d64b85bfcd236186a7e87c11c2eb290627c27659846ff760189f63c581b0
MD5 d28e1c81a44f6b57498ab7b1721f449a
BLAKE2b-256 bbfb4297602e818b04c75d5e36f1a20032b3decc0d6fbbea313beecf9a0ebf96

See more details on using hashes here.

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