{ "info": { "author": "Ross Patterson", "author_email": "me@rpatterson.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: System :: Logging", "Topic :: Utilities" ], "description": "================================================\nservice-logging\n================================================\nPython logging configurations done The Right Way\n------------------------------------------------\n\nTL;DR:\n\n ``logging.basicConfig()`` is very often not enough, leading to DRY\n violations. Use ``service-logging`` to log to syslog or the Windows event\n log when running in the background, and log to stderr when running in the\n foreground, both with well formatted messages.\n\nUsing logging correctly is often both usage and OS specific. For a usage\nspecific example, when developing or troubleshooting a daemon and/or service\nit is often useful to use one logging configuration when running in the\nforeground in a shell and another when running in the background. For an OS\nspecific example, when running in the background a daemon and/or service\nshould use the appropriate logging service for that system so that logging\nmetadata is correct (severity, facility, etc.), but the right way to do that\nis OS specific. Furthermore, deciding between these configurations requires\nlogic that cannot be done through the simple configuration mechanisms provided\nby Python's ``logging.config``.\n\nGiven these realities, logging is often not done \"The Right Way\", and/or is\ndifficult to adjust for debugging/testing vs background. ``service-logging``\naims to address this by providing the logic to choose between correct logging\nconfigurations for different usages and OSes. It also provides several ways\nto use these configurations, making the depth of commitment opt-in.\n\nUse ``servicelogging.basicConfig()`` to add an OS and usage specific root\nlogging hander::\n\n >>> import servicelogging\n >>> servicelogging.basicConfig()\n\nYou can also use ``servicelogging`` as a script to run another script with\nlogging configured::\n\n $ python -m servicelogging foreground_demo.py\n $ python servicelogging.py background_demo.py\n $ servicelogging foreground_demo.py\n\nOr if you just want the appropriate handler and formatter to use as you'd like\nin your code, you can use ``servicelogging.choose_handler()``::\n\n >>> import servicelogging\n >>> handler = servicelogging.choose_handler()\n\n\n----------------------------\nTODO\n----------------------------\nFeatures for future releases\n____________________________\n\nSupport alternate logging configuration options:\n\n Make sure that the approach is compatible with the various Python\n ``logging.config`` options.\n\nAnything else you find youself doing over and over:\n\n Submit a PR and make an argument for why a change would be useful in the\n vast majority of cases.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi/service-logging", "keywords": "logging syslog nteventlog console", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "service-logging", "package_url": "https://pypi.org/project/service-logging/", "platform": "", "project_url": "https://pypi.org/project/service-logging/", "project_urls": { "Homepage": "https://pypi.python.org/pypi/service-logging" }, "release_url": "https://pypi.org/project/service-logging/0.1/", "requires_dist": null, "requires_python": "", "summary": "Python logging configurations done The Right Way for programs that may run in the foreground or background", "version": "0.1" }, "last_serial": 3192494, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c87b022205212407db0a2f7e48abde71", "sha256": "7d34bd842dc9423275ba03fbbf5a38d5f909767fa3b0c594d1a493d3bc5171e6" }, "downloads": -1, "filename": "service-logging-0.1.tar.gz", "has_sig": false, "md5_digest": "c87b022205212407db0a2f7e48abde71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2660, "upload_time": "2017-09-21T18:22:29", "url": "https://files.pythonhosted.org/packages/7c/02/3e000463d48907c08ef208e6b2ad6e2dcc1789ec059db9eebeec20bdd8ce/service-logging-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c87b022205212407db0a2f7e48abde71", "sha256": "7d34bd842dc9423275ba03fbbf5a38d5f909767fa3b0c594d1a493d3bc5171e6" }, "downloads": -1, "filename": "service-logging-0.1.tar.gz", "has_sig": false, "md5_digest": "c87b022205212407db0a2f7e48abde71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2660, "upload_time": "2017-09-21T18:22:29", "url": "https://files.pythonhosted.org/packages/7c/02/3e000463d48907c08ef208e6b2ad6e2dcc1789ec059db9eebeec20bdd8ce/service-logging-0.1.tar.gz" } ] }