Skip to main content

Automate IT operations

Project description

Quick using logger

This small project purpose is to add nice and clean logs to your app. Just import the quickbelog.Log class wherever you need and start using it. To make debugging easier by default it will include the name of the source file and line number in order to understand what code line is responsible for the output.

Usage:

from quickbelog import Log

Log.info(msg='This is an info message')
Log.debug(msg='This is a debug message')
Log.warning(msg='This is a warning message')
Log.error(msg='This is an error message')
try:
    raise ValueError('Just for testing')
except ValueError:
    quickbe.Log.exception('Something failed')

Output

2022-03-14 15:54:03,411 > INFO  test_logger.py(17) method: test_basic_log_message        This is an info message
2022-03-14 15:54:03,411 > DEBUG        test_logger.py(21) method: test_debug_message    This is a debug message
2022-03-14 15:54:03,411 > WARNING      test_logger.py(29) method: test_warning_message          This is a warning message
2022-03-14 15:54:03,412 > ERROR        test_logger.py(33) method: test_error_message    This is an error message
2022-03-14 15:54:03,412 > ERROR        test_logger.py(13) method: test_exception_logging        Something failed
Traceback (most recent call last):
  File ".\test_logger.py", line 11, in test_exception_logging
    raise ValueError('Just for testing')
ValueError: Just for testing

Have fun :-)

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

quickbelog-1.1.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

quickbelog-1.1.0-py3-none-any.whl (3.9 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