Skip to main content

ezpylogger: Log easier and simpler

Project description

ezpylogger: Logging made simpler


What is this?

This is an easy to use, logging library that can log function calls of ANY functions!
This includes functions that you've made, functions that have been predefined. (Like any functions/methods that are included in other libraries)

How do you use this?

Simple, just import the ezpylogger module and use the Logger to log function calls.
Example:

from ezpylogger import Logger
from time import sleep

@Logger()
def add(a, b):
    return a + b

class Mul:
    logger = Logger()

    def __init__(self):
        pass

    @logger
    def __call__(self, *args, **kwargs):
        numbers = [ arg if arg.__class__.__name__ == 'int' or arg.__class__.__name__ == 'float' else 1 for arg in args ]
        rv = [1]
        for number in numbers:
            rv[0] *= number

        # Some very heavy computational task
        self.logger(sleep)(30)

        return rv + numbers

seven = add(3, 4)
prod = Mul()(1, 2, 3, 4, 5, 6, 7, 0.08, 0.69, 4.20)

Installation

python3 -m pip install ezpylogger

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

ezpylogger-0.1.3.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

ezpylogger-0.1.3-py3-none-any.whl (2.5 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