Metadata-Version: 2.1
Name: coelog2db
Version: 0.3.1
Summary: Utility to write logging to influxdb2 in order to gather some application stats. After using this utility, user can create dashboard in Grafana with InfluxDB.
Home-page: https://github.com/robsonyeg/log2db
Author: Robin Song
Author-email: robin.song@edmonton.ca
License: MIT license
Keywords: log2db
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.8
License-File: LICENSE
License-File: AUTHORS.rst

============================
Logging Utility to Database
============================


Utility to write logging to database in order to gather some application stats.


* Free software: MIT license

Features
--------

* Funciton can be extended to different database in future.
* A helper to log information to InfluxDB2 for further report purpose.
* The functions here catch the errors, if anything goes wrong it still return and won't break main program logic. But the information won't be recorded in InfluxDB.

Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

============================
Developer's Causion
============================

This package is hosted by pypi public. Do not include any sensitive information in this project.


============================
Usage
============================

Install
--------

Installation

::

    pip install coelog2db


Usage:

::

    import logging
    from log2db.log2db import Log2DB
    from log2db.log2influx import Log2Influx

    log2 = Log2DB.get_instance(Log2Influx,conf=conf["influxdb"],user="cronjob")
    log2.log(log_level=logging.INFO,message="Loading started") # log this message before acture logic starts

    try:
        # main code
        # make sure throw except in your code if you catched them in subprocess

        pass
    except Exception as ex:
            log2.log(logging.ERROR,message="download job failed. " + str(ex))




=======
History
=======

0.1.1 (2022-06-01)
------------------

* First release on PyPI.
