{ "info": { "author": "Jason Moiron", "author_email": "jason@hiidef.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License" ], "description": "pylogd\n------\n\npylogd is a python interface to `logd`_. It pushes log messages or statistics\nto logd over a UDP socket.\n\nusage\n-----\n\npylogd ships various utilities to deal with `logd`_, python `logging`_ handlers,\nand a ``Stats`` object which makes it trivial to record statistics.\n\nlogging\n~~~~~~~\n\nTo log to logd using the python logging module, create a new handler with your\nlogd server's host and port and then set it up as your default logging handler::\n\n from pylogd.handlers import PylogdHandler\n handler = PylogdHandler('mylogpath.log', '127.0.0.1', 8126)\n logger = logging.getLogger()\n logger.setHandler(handler)\n\nNow, subsequent calls to ``logger.(error|warn|etc)`` will log to your logd\nserver. If you do this on the root logger (``getLogger('base')``), it will\napply to all subsequently created loggers.\n\nTo delete a log, use ``pylogd.delete_log`` with the host and port of logd::\n\n from pylogd import delete_log\n delete_log('mylogpath.log', host='127.0.0.1', 8126)\n\nstats\n~~~~~\n\nTo use stats, create a stats handle::\n\n from pylogd.stats import Logd\n stats = Logd('127.0.0.1', 8126)\n\nYou can also supply an optional prefix which will be prepended to all of your\nstats, so that multiple applications can use the same logd/graphite server\nwithout having to repeate their per-app key for every stats call.\n\nOnce you have a Logd object, you can increment & decrment counters (with an \noptional sample rate)::\n\n stats.increment('my.counter')\n stats.change_by('my.counter', 10)\n stats.decrement('my.counter', 0.05) # only update 5% of the time\n\nYou can also set the value of a meter::\n\n stats.set('my.meter', 30)\n stats.set('my.meter', 30, 0.25) # only set 25% of the time\n\nThere's a basic time interface as well as a convenient timer interface::\n\n stats.time('my.timer', 11.43) # time manually\n\n # automatically start & stop a timer\n stats.timer.start('my.timer')\n do_some_timed_operation()\n stats.timer.stop('my.timer')\n\n # time this function with a 10% sample rate\n @stats.timed('my.long_operation', 0.1)\n def long_operation():\n pass\n\n # accumulate time done doing various similar tasks\n stats.timer.start_accumulator('timers.mysql')\n do_some_mysql_stuff()\n stats.timer.stop_accumulator('timers.mysql')\n non_mysql_things()\n stats.timer.start_accumulator('timers.mysql')\n do_some_more_mysql_stuff()\n stats.timer.stop_accumulator('timers.mysql')\n\n # send this timing information to logd\n stats.timer.flush_accumulator('timers.mysql')\n\n\ntwisted support\n---------------\n\nFor twisted users, use ``pylogd.twisted`` (included) instead of ``pylogd``, and \nnote that log messages and stats will not go to logd until the reactor has been\nstarted.\n\n.. _logd: https://github.com/hiidef/logd\n.. _logging: http://docs.python.org/library/logging.html", "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/hiidef/logd'", "keywords": "logd python udp logging server client", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pylogd", "package_url": "https://pypi.org/project/pylogd/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pylogd/", "project_urls": { "Download": "UNKNOWN", "Homepage": "'http://github.com/hiidef/logd'" }, "release_url": "https://pypi.org/project/pylogd/0.2/", "requires_dist": null, "requires_python": null, "summary": "logd python library", "version": "0.2" }, "last_serial": 797375, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "cc9922c19575403f31969d643fdc391c", "sha256": "6b9ad8828833b6f7953b91b30654b3c13ac81c9905761ce60a2edbacd175bc60" }, "downloads": -1, "filename": "pylogd-0.2.tar.gz", "has_sig": false, "md5_digest": "cc9922c19575403f31969d643fdc391c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6482, "upload_time": "2012-01-13T22:21:38", "url": "https://files.pythonhosted.org/packages/a0/92/76e78a5785da00fccc9bbfea30c1fad6287c4068a8e9cf6c69d507c54e7d/pylogd-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cc9922c19575403f31969d643fdc391c", "sha256": "6b9ad8828833b6f7953b91b30654b3c13ac81c9905761ce60a2edbacd175bc60" }, "downloads": -1, "filename": "pylogd-0.2.tar.gz", "has_sig": false, "md5_digest": "cc9922c19575403f31969d643fdc391c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6482, "upload_time": "2012-01-13T22:21:38", "url": "https://files.pythonhosted.org/packages/a0/92/76e78a5785da00fccc9bbfea30c1fad6287c4068a8e9cf6c69d507c54e7d/pylogd-0.2.tar.gz" } ] }