Skip to main content

Logging made simple and beautiful

Project description

Logger

Logger is a Python package that makes logging easy

Installation

pip install loggerpyth

Get Started

Info, Warning, Success

Every method takes in an area, a message and an option loc which represents the current line of code, it can be got by using 'Logger.line()' or by passing an integer

from Logger.Logger import Logger

Logger.info(area='Main', message='This is an info', 
        loc=Logger.line())

Logger.warning(area='Main', message='This is a warning', 
        loc=Logger.line())

Logger.success(area='Main', message='This is a success', 
        loc=Logger.line()) 
        

Output

output

Error

The error method provides an exception that can be passed by the user with a message or it will be the default 'Exception' raised with an empty string

default
Logger.error(area='Main', message='Error',loc=Logger.line())

output

custom error
Logger.error(area='Main', message='Error', 
    error=Logger.Err(ValueError, 'msg'),loc=Logger.line())

output

You can also perform and check operation (of two types)

Operation

It will be 'raised' a success if the operation goes as it should, a warning otherwise

    
Logger.operation(name='Sum', result=2+2, expected_result=5)

Logger.operation(name='Sum', result=2+2, expected_result=4)

output

Debug

It will be 'raised' a success if the operation goes as it should, an error otherwise

Logger.debug(name='Sum', result=2+2, expected_result=5,
    error=Logger.Err(ValueError, 'msg'))

Logger.debug(name='Sum', result=2+2, expected_result=4,         
    error=Logger.Err(ValueError, 'msg'))

output output

Github: https://github.com/Bilodev/

Project details


Release history Release notifications | RSS feed

This version

1.3

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

loggerpyth-1.3-py3-none-any.whl (3.0 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