Skip to main content

Documentation build, testing and linting for the master branch.

https://readthedocs.org/projects/logger-helper/badge/?version=latest https://travis-ci.org/vimist/logger-helper.svg?branch=master https://api.codeclimate.com/v1/badges/17691babd47c3cc19e91/maintainability https://api.codeclimate.com/v1/badges/17691babd47c3cc19e91/test_coverage

Logger Helper

Logger Helper provides a simple way to gather verbose logs within your application. Set up your logging using the standard logging library and decorate your classes, methods and functions (or even do it at the module level with the mod method) to get detailed logs of what your application is doing:

Calling __main__.Test.add(a = 1, b = 2, c = 3)
Returned 6 from __main__.Test.add
Calling __main__.Test.subtract(a = 3, b = 2, c = 2)
Returned -1 from __main__.Test.subtract
Calling __main__.Test.divide_by_zero(a = 10)
Exception ZeroDivisionError occurred, "division by zero"

Installation

To install the Logger Helper package, ensure you have pip installed using your distributions package manager and then run the following command:

pip install logger-helper

Basic Usage

You can start using the LoggerHelper right away.

import logging
from logger_helper import LoggerHelper

# Perform your standard logging setup here

log = LoggerHelper(logging.getLogger(__name__), logging.DEBUG)

# DONE! Start decorating your modules, classes and functions:

@log
class MyClass:
    def method_1(self):
        pass

    def method_2(self):
        pass

@log
def function():
    pass

For more information, be sure to read the documentation. If you clone this repository and install invoke, you can serve the documentation locally with invoke serve-docs.

Download files

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

Source Distribution

logger-helper-0.0.4.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file logger-helper-0.0.4.tar.gz.

File metadata

  • Download URL: logger-helper-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for logger-helper-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bb146e8c3a48526cd4fa553671f23232efeb347cfdaf6840a1e346edf25ad546
MD5 7c51c87f3515a7ce69a8283f15aafc3e
BLAKE2b-256 675f51ea34dc7395da4115078e458aacd06f60d5b272dcf77702cc16cd033192

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.0

1 file

0.0.5

1 file

This release

0.0.4 This release

1 file

0.0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page