Metadata-Version: 2.1
Name: log-decor
Version: 2.0.2
Summary: Logging decorators for functions and methods.
License: MIT
Keywords: logging,decorator,OOP
Author: Bernardo Paulsen
Author-email: paulsen.bernardo@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Project-URL: Documentation, https://bernardopaulsen.github.io/log_decor/
Project-URL: GitHub, https://github.com/bernardopaulsen/log_decor
Description-Content-Type: text/x-rst

log-decor
=========

Introduction
############

This package contains decorators that provide logging functionality for functions
and methods.

Example
#######

.. code-block:: python

    import logging

    from log_decor import add_logger, log_msg


    @add_logger()
    class Example:

        @log_msg('message', level=logging.DEBUG)
        def f1(self):
            pass

        @log_msg(level=logging.INFO)
        def f2(self):
            pass


>>> logging.basicConfig(level=logging.DEBUG)
>>> example = Example()
>>> example.f1()
DEBUG:Example:message
>>> example.f2()
INFO:Example:f2()
