Skip to main content

Helpful wrappers for logging

Project description

# (E)a(z)y (log)ging

Wrappers to make eazy logging of functions and members calls.
Allow to track parameters, exceptions and performance of functions.

# Installation

Simple as `pip3 install ezlog`

# Some examples on how to use it

To log function call
from ezlog.wrappers import log_call

def test(a, b):
return 4

test(2, "test")

To log class member call
from ezlog.wrappers import log_member_call

class A:
def test(self, a, b, **kwargs):

a.test(2, 4, test={"d":"t", "c":"o"})

# Customization

Default behavior can be overriden using followin module wide parameters:

- default_log_level
Override for default logging level.

- default_performance_measure
Override default behavior for measuring performance or not.

- default_logging
Override default logger.

- default_eps
Limit for prevent spamming extremely low measurements.

- default_one_line_log
Override default logging style.
If True - log only one line (Called (args), result)
If False(default) - log in 2 lines (Calling... Done).

- default_log_arguments
Override default settings to log arguments or not.

- default_log_result
Override default settings to log function result or not.

Project details

Download files

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

Files for ezlog, version 0.8
Filename, size File type Python version Upload date Hashes
Filename, size ezlog-0.8.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page