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 hashes)

Uploaded Source

Built Distribution

whylog-0.1-py3-none-any.whl (15.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