{ "info": { "author": "Quantlane", "author_email": "code@quantlane.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only" ], "description": "Logwood\n=======\n\nThis is a simple, but fast logging library. We traded features for speed.\n\nLogwood is only tested with Python 3.5. There are no plans to support older versions.\n\n.. code-block:: python\n\n\timport logwood\n\tfrom logwood.handlers.stderr import ColoredStderrHandler\n\n\tlogwood.basic_config(\n\t\tlevel = logwood.INFO,\n\t\thandlers = [ColoredStderrHandler()]\n\t)\n\n\tlogger = logwood.get_logger('LoggerName')\n\tlogger.info('Just FYI')\n\tlogger.warning('Six times seven is {:d}.', 42)\n\n\nFeatures\n--------\n\nWhile logwood is very lightweight (see the Compatibility section below) it still gives you a few nice features\nout of the box:\n\n- Chunked syslog handler. Splits long messages and writes them to syslog piece by piece. Useful e.g. to work\n around maximum UDP packet size (:code:`logwood.handlers.chunked.ChunkedSysLogHandler`).\n- Alternative syslog handler that uses the `standard syslog module `_\n to emit logs to local syslog. Benchmarks show this to be faster than connecting and writing to a :code:`socket`\n directly (:code:`logwood.handlers.syslog.SysLogLibHandler`).\n- Threaded handler: executes any underlying handler in a separate thread to avoid blocking the main thread\n (:code:`logwood.handlers.threaded.ThreadedHandler`).\n- Colored logs on stderr (:code:`logwood.handlers.stderr.ColoredStderrHandler`).\n\n\nCompatibility with :code:`logging`\n----------------------------------\n\nLogwood API is somewhat similar to the standard :code:`logging`, but we've made a few opinionated design decisions\nthat do not make this a drop-in replacement:\n\n- Loggers do not form a tree hierarchy. There are no child loggers and no handler or configuration inheritance.\n We found that such features make the :code:`logging` module very slow.\n- Logging config cannot be changed after loggers are created, and conversely no loggers may be created until\n logging is configured. Again, this is to make loggers as simple as possible.\n- While %-style formatting is supported for historical reasons, logwood prefers the more powerful :code:`str.format`.\n It tries to guess which formatting style you're using but defaults to :code:`str.format` (curly braces).\n This feature will be removed in a future major release and only :code:`str.format` will be supported going forward.\n\n:code:`logging` -> :code:`logwood` bridge\n.........................................\n\nCall :code:`logwood.compat.redirect_standard_logging()` to configure the standard :code:`logging` module to send\nall messages to :code:`logwood` for handling. You can use this to run a :code:`logwood`-based application that\nnevertheless works with any 3rd-party libraries using :code:`logging`.\n\n\npy.test fixtures\n----------------\nFor testing convenience there are two fixtures prepared: :code:`configure_and_reset_logwood` and :code:`logwood_handler_mock`.\n:code:`configure_and_reset_logwood` is an autouse fixture, i.e. it is run before every test in projects that use logwood.\nIt calls :code:`logwood.basic_config` to set a stderr handler so you don't have to care about logwood configuration\nin tests, and you can see logs when your test fails.\nThe :code:`logwood_handler_mock` fixture is a mock handler. This is useful for testing how your code uses logwood.\nIt stores all messages in a dict of lists so you can easily find your messages. To identify the level you can use\neither strings (upper/lowercase) or constants from logging or logwood:\n\n.. code-block:: python\n\n\timport logwood\n\n\tdef some_func():\n\t\tlogger = logwood.get_logger('test_logger')\n\t\tlogger.warning('Something is wrong with id {}', 42)\n\n\n\tdef test_logwood(logwood_handler_mock):\n\t\tsome_func()\n\t\tassert 'Something is wrong with id 42' in logwood_handler_mock['WARNING']\n\t\tassert not logwood_handler_mock['error']\n\t\tassert any(m.startswith('Something') for m in logwood_handler_mock[logwood.WARNING])", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/qntln/logwood", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "logwood", "package_url": "https://pypi.org/project/logwood/", "platform": "", "project_url": "https://pypi.org/project/logwood/", "project_urls": { "Homepage": "https://github.com/qntln/logwood" }, "release_url": "https://pypi.org/project/logwood/3.1.0/", "requires_dist": null, "requires_python": "", "summary": "Simple, but fast logging library for Python 3.5+", "version": "3.1.0" }, "last_serial": 2495961, "releases": { "0.0.0": [], "3.0.0": [ { "comment_text": "", "digests": { "md5": "05e325c2bde5e7a5e4f44db3725a12be", "sha256": "194d335a420ef85943a73c1b558ee3a308e57a07f5cfaf7378477ccec1633511" }, "downloads": -1, "filename": "logwood-3.0.0.tar.gz", "has_sig": true, "md5_digest": "05e325c2bde5e7a5e4f44db3725a12be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10865, "upload_time": "2016-11-20T12:15:52", "url": "https://files.pythonhosted.org/packages/81/32/8127041468b0a0e5249c4a9a25fba963e87a9ece6fe947845c02ba92b423/logwood-3.0.0.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "65385028a945c28002b4e08ca25f8968", "sha256": "33784f8192159e80768356c0474180ac168df5085edff4b112af2bc60f359126" }, "downloads": -1, "filename": "logwood-3.1.0.tar.gz", "has_sig": true, "md5_digest": "65385028a945c28002b4e08ca25f8968", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11788, "upload_time": "2016-12-02T14:44:49", "url": "https://files.pythonhosted.org/packages/1c/7c/1294695c7f53d6101adb88c98aacb8cfa27a68adf29debc129b7a51d88e5/logwood-3.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "65385028a945c28002b4e08ca25f8968", "sha256": "33784f8192159e80768356c0474180ac168df5085edff4b112af2bc60f359126" }, "downloads": -1, "filename": "logwood-3.1.0.tar.gz", "has_sig": true, "md5_digest": "65385028a945c28002b4e08ca25f8968", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11788, "upload_time": "2016-12-02T14:44:49", "url": "https://files.pythonhosted.org/packages/1c/7c/1294695c7f53d6101adb88c98aacb8cfa27a68adf29debc129b7a51d88e5/logwood-3.1.0.tar.gz" } ] }