Metadata-Version: 2.1
Name: logging-nice-handlers
Version: 0.1.0
Summary: Library with nice preset logging handlers for logging library
Home-page: https://github.com/stas-prokopiev/logging_nice_handlers
Author: stanislav prokopyev
Author-email: stas.prokopiev@gmail.com
License: mit
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/x-rst; charset=UTF-8
Requires-Dist: char
Provides-Extra: testing
Requires-Dist: pytest ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'

=====================
logging_nice_handlers
=====================

.. image:: https://img.shields.io/github/last-commit/stas-prokopiev/logging_nice_handlers
   :target: https://img.shields.io/github/last-commit/stas-prokopiev/logging_nice_handlers
   :alt: GitHub last commit

.. image:: https://img.shields.io/github/license/stas-prokopiev/logging_nice_handlers
    :target: https://github.com/stas-prokopiev/logging_nice_handlers/blob/master/LICENSE.txt
    :alt: GitHub license<space><space>

.. image:: https://readthedocs.org/projects/logging_nice_handlers/badge/?version=latest
    :target: https://logging_nice_handlers.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://travis-ci.org/stas-prokopiev/logging_nice_handlers.svg?branch=master
    :target: https://travis-ci.org/stas-prokopiev/char

.. image:: https://img.shields.io/pypi/v/logging_nice_handlers
   :target: https://img.shields.io/pypi/v/logging_nice_handlers
   :alt: PyPI

.. image:: https://img.shields.io/pypi/pyversions/logging_nice_handlers
   :target: https://img.shields.io/pypi/pyversions/logging_nice_handlers
   :alt: PyPI - Python Version


.. contents:: **Table of Contents**

Overview.
=========================
This library consists of different logging handlers which I see usefull in different projects.

Installation via pip:
======================

.. code-block:: bash

    pip install char

logging Handlers
============================

AllLevelFileHandler
------------------------------
| This handler quite similar to logging.FileHandler but instead of FileHandler
| it saves not in one file but in separate file for every level
| So as the results in some directory you will get files

- debug_msgs.txt - For all messages for levels logging.DEBUG and above
- info_msgs.txt - For all messages for levels logging.INFO and above
- warning_msgs.txt - For all messages for levels logging.WARNING and above
- error_msgs.txt - For all messages for levels logging.ERROR and above

| Such structure of logs can be quite usefull if your projected is expected to be used by externel users
| So in case of some errors all these files with logs can be sent to the author and be analyzed.

.. code-block:: python

    import logging
    from logging_nice_handlers import AllLevelFileHandler

    LOGGER = logging.getLogger(__name__)
    LOGGER.setLevel(10)
    LOGGER.addHandler(
        AllLevelFileHandler(
            str_path_dir_with_logs="Logs",
            str_open_mode="w",
        )
    )
    LOGGER.info("Hi friend!")

JupyterStreamHandler
------------------------------
| This handler is the replacement for logging.StreamHandler when it should be used in jupyter notebooks
| It will highlight in red all messages with the level which is above some set level.
| So you won't miss that the warnings or errors are happening in you programm.


.. code-block:: python

    import logging
    from logging_nice_handlers import JupyterStreamHandler

    LOGGER = logging.getLogger(__name__)
    LOGGER.setLevel(10)
    LOGGER.addHandler(
        JupyterStreamHandler(
            int_min_stdout_level=logging.INFO,
            int_min_stderr_level=logging.WARNING,
        )
    )
    LOGGER.warning("Hi friend!")


Links
=====

    * `PYPI <https://pypi.org/project/logging_nice_handlers/>`_
    * `readthedocs <https://logging_nice_handlers.readthedocs.io/en/latest/>`_
    * `GitHub <https://github.com/stas-prokopiev/logging_nice_handlers>`_

Project local Links
===================

    * `CHANGELOG <https://github.com/stas-prokopiev/logging_nice_handlers/blob/master/CHANGELOG.rst>`_.
    * `CONTRIBUTING <https://github.com/stas-prokopiev/logging_nice_handlers/blob/master/CONTRIBUTING.rst>`_.

Contacts
========

    * Email: stas.prokopiev@gmail.com
    * `vk.com <https://vk.com/stas.prokopyev>`_
    * `Facebook <https://www.facebook.com/profile.php?id=100009380530321>`_

License
=======

This project is licensed under the MIT License.



