{ "info": { "author": "Pier Carlo Chiodi", "author_email": "pierky@pierky.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Logging", "Topic :: System :: Networking" ], "description": "Buffered SMTP Logging Handler\n=============================\n\n|PYPIVersion| |PythonVersions| |BuildStatus| |Coveralls|\n\nA library that mimics the standard ``logging.handlers.SMTPHandler`` class but sends email messages only when a preconfigured buffer is full or on exit.\n\nInstallation and dependencies\n-----------------------------\n\nInstall the program using pip:\n\n.. code::\n\n pip install buffered_smtp_handler\n\nHow to use it\n-------------\n\nThis library offers two classes: ``BufferedSMTPHandler`` and ``BufferedSMTPHandlerSSL``.\n\nThey accept the same arguments of the `standard SMTPHandler class `__, and also the ``capacity`` argument to set the capacity of the buffer (default: 100).\n\nThe SSL version is based on the ``smtplib.SMTP_SSL`` and avoids to perform StartSSL.\n\nVia code:\n\n>>> import logging\n>>> from pierky.buffered_smtp_handler import BufferedSMTPHandler\n>>> logger = logging.getLogger(\"my_app\")\n>>> logger.setLevel(logging.INFO)\n>>> h = BufferedSMTPHandler(\"smtp.example.com\", \"from@example.com\", [\"to@example.com\"], \"MyApp log\", capacity=10)\n>>> logger.addHandler(h)\n>>> logger.warning(\"Test\")\n\nVia a `logging configuration file `__:\n\n.. code::\n\n [loggers]\n keys=root\n \n [formatters]\n keys=simple\n \n [handlers]\n keys=stderr,smtp\n \n [logger_root]\n level=INFO\n \n handlers=stderr,smtp\n \n [formatter_simple]\n format=ARouteServer %(asctime)s %(levelname)s %(message)s\n \n [handler_stderr]\n class=StreamHandler\n formatter=simple\n args=(sys.stderr,)\n \n [handler_smtp]\n class=pierky.buffered_smtp_handler.BufferedSMTPHandler\n level=WARN\n formatter=simple\n args=(('smtp.example.com', 25), 'from@example.com', ['to@example.com'], 'MyApp log')\n\n\nAuthor\n------\n\nPier Carlo Chiodi - https://pierky.com/\n\nBlog: https://blog.pierky.com/ Twitter: `@pierky `_\n\n.. |PYPIVersion| image:: https://img.shields.io/pypi/v/buffered_smtp_handler.svg\n :target: https://pypi.python.org/pypi/buffered_smtp_handler/\n.. |PythonVersions| image:: https://img.shields.io/pypi/pyversions/buffered_smtp_handler.svg\n.. |BuildStatus| image:: https://travis-ci.org/pierky/bufferedsmtphandler.svg?branch=master\n :target: https://travis-ci.org/pierky/bufferedsmtphandler\n.. |Coveralls| image:: https://coveralls.io/repos/github/pierky/bufferedsmtphandler/badge.svg?branch=master\n :target: https://coveralls.io/github/pierky/bufferedsmtphandler?branch=master\n\n\nChange log\n==========\n\nv0.1.0\n------\n\nFirst release.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/pierky/bufferedsmtphandler", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pierky/bufferedsmtphandler", "keywords": "logging,python", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "buffered-smtp-handler", "package_url": "https://pypi.org/project/buffered-smtp-handler/", "platform": "", "project_url": "https://pypi.org/project/buffered-smtp-handler/", "project_urls": { "Download": "https://github.com/pierky/bufferedsmtphandler", "Homepage": "https://github.com/pierky/bufferedsmtphandler" }, "release_url": "https://pypi.org/project/buffered-smtp-handler/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A buffered logging handlers that mimics SMTPHandler", "version": "0.1.0" }, "last_serial": 3266315, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fe090b3c126ab1b105155bb9de209727", "sha256": "e3d1a80b0d65a445b4264559ccfdf67cfa271c36972332436995b733b60650cb" }, "downloads": -1, "filename": "buffered_smtp_handler-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fe090b3c126ab1b105155bb9de209727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18942, "upload_time": "2017-10-20T16:47:49", "url": "https://files.pythonhosted.org/packages/54/1b/bbfeb8f5c54f1810049e4146765fa7fb7cd4e46eaa5c5913b4e2733429d5/buffered_smtp_handler-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fe090b3c126ab1b105155bb9de209727", "sha256": "e3d1a80b0d65a445b4264559ccfdf67cfa271c36972332436995b733b60650cb" }, "downloads": -1, "filename": "buffered_smtp_handler-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fe090b3c126ab1b105155bb9de209727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18942, "upload_time": "2017-10-20T16:47:49", "url": "https://files.pythonhosted.org/packages/54/1b/bbfeb8f5c54f1810049e4146765fa7fb7cd4e46eaa5c5913b4e2733429d5/buffered_smtp_handler-0.1.0.tar.gz" } ] }