coelog2db-0.3.1
توضیحات
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.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | coelog2db-0.3.1 |
| نام | coelog2db |
| نسخه کتابخانه | 0.3.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Robin Song |
| ایمیل نویسنده | robin.song@edmonton.ca |
| آدرس صفحه اصلی | https://github.com/robsonyeg/log2db |
| آدرس اینترنتی | https://pypi.org/project/coelog2db/ |
| مجوز | MIT license |
============================
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.
نیازمندی
| مقدار | نام |
|---|---|
| >=1.29.1 | influxdb-client[async] |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl coelog2db-0.3.1:
pip install coelog2db-0.3.1.whl
نصب پکیج tar.gz coelog2db-0.3.1:
pip install coelog2db-0.3.1.tar.gz