Metadata-Version: 2.1
Name: mylogging
Version: 1.1.1
Summary: Small library for printing warnings and creating logs.
Home-page: https://github.com/Malachov/mylogging
Author: Daniel Malachov
Author-email: malachovd@seznam.cz
License: mit
Description: # mylogging
        
        [![PyPI pyversions](https://img.shields.io/pypi/pyversions/mylogging.svg)](https://pypi.python.org/pypi/mylogging/) [![PyPI version](https://badge.fury.io/py/mylogging.svg)](https://badge.fury.io/py/mylogging) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Malachov/mylogging.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Malachov/mylogging/context:python) [![Build Status](https://travis-ci.com/Malachov/mylogging.svg?branch=master)](https://travis-ci.com/Malachov/mylogging) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![codecov](https://codecov.io/gh/Malachov/mylogging/branch/master/graph/badge.svg)](https://codecov.io/gh/Malachov/mylogging)
        
        My python logging module. Based on debug value prints warnings and errors. It's automatically colorized. It can be logged to file if configured.
        
        Documentation does not exists, because it's such a small project, that it's not necessary.
        
        Motivation for this project is, that i need this functionallity in each project, so to not repeat myself.
        
        ## Example
        
        ```python
        import mylogging
        
        # We can define whether to
        #   display warnings: debug=1,
        #   ignore warnings: debug=0,
        #   stop warnings as errors: debug=3
        
        mylogging.set_warnings(debug=1, ignored_warnings=["invalid value encountered in sqrt",
                                                         "encountered in double_scalars"])
        
        # We can create warning that will be displayed based on warning settings
        mylogging.user_warning('Hessian matrix copmputation failed for example', caption="RuntimeError on model x")
        
        # In case we don't know exact error reason, we can use traceback_warning in try/except block
        
        try:
            u = 10 / 0
        
        except Exception:
            mylogging.traceback_warning("Maybe try to use something different than 0")
        
        # In case we don't want to warn, but we have error that should be printed anyway and not based on warning settings, we can use user_message that return extended that we can use...
        
        mylogging.user_message("I will be printed anyway")
        ```
        
        This is the result of the upper snippet
        
        <p align="center">
        <img src="logging.png" width="620" alt="Plot of results"/>
        </p>
        
        If you want to log warnings into text file or it will be printed for example on some CI log console, colors will be probably changed into unwanted symbols. For such a cases you can use this after the import
        
        ```python
        mylogging._COLORIZE = 0  # Turn off colorization on all functions
        ```
        
Platform: any
Classifier: Programming Language :: Python
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Natural Language :: English
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Description-Content-Type: text/markdown
