{ "info": { "author": "Carteaux, Michel", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python", "Topic :: System :: Logging" ], "description": "# chouf\n\nLogging handler how do custom action\n\n## Description\n\nI was looking for a light framework able to act when something wrong arrive on execution.\nI didn't need a big solution.\n\nFor my project, when I was loosing USB connection I want to act quickly.\n\nIf a log record CRITICAL arrive 2 times in less than 2 seconds, It's easy to act with the lib.\n\nLet me show you.\n\n\n```python\nfrom chouf.chouffer import ChoufHandler\nfrom chouf.triggers.base import FilterMatch\nfrom chouf.triggers.repeat import RepeatedRecordTrigger\n\ndef action():\n print('Action fired')\n\nf = FilterMatch(min_level=logging.CRITICAL, name='^.*$', msg='^.*$')\nrrt = RepeatedRecordTrigger(times=10, period_s=5, filters=[f], action=lambda: action())\nch = ChoufHandler(triggers=[rrt])\nlogging.root.addHandler(ch)\n```\n\nWith this piece of code If a log record arrive 10 times in 5 second action will be run", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/pepitooo/chouf", "keywords": null, "license": "none", "maintainer": null, "maintainer_email": null, "name": "chouf", "package_url": "https://pypi.org/project/chouf/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/chouf/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/pepitooo/chouf" }, "release_url": "https://pypi.org/project/chouf/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Log handler with action", "version": "0.0.2" }, "last_serial": 2466381, "releases": { "0.0.2": [] }, "urls": [] }