{ "info": { "author": "Jonatan Nilsson", "author_email": "jonatan@nilsson.is", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: System :: Logging", "Topic :: Utilities" ], "description": "treelogger4mongo\n================\n\nThe treelogger4mongo is a simple module that allows you to lo debug data into a mongo database. The only difference is that this module supports logging in a tree-like structure.\n\n## How does it work?\n\nLets imagine we have a process that has to loop through all your user database. Adding the mongo logger would only have to be something like this:\n\n import treelogger4mongo as treelog\n\n def process_users(users):\n \tbranch = treelog.info(\"About to process %s users.\" % len(users))\n for user in users:\n sub = branch.info(\"Processing: %s\" % user.username,\n {'username': user.username,\n 'email': user.email})\n #do something with user.\n sub.info(\"Did something with user.\")\n #something else\n if user.is_special:\n \tsome_heavy_function(user, sub.info(\"Starting some_heavy_function.\"))\n sub.info(\"Finished processing.\")\n\nWhat we get from this is a root log entry with the message \"About to process ... users.\". However, this is where treelogger comes strong in, each log message after that is applied like a branch to that root log entry.\n\nA sample output would be a log structure in mongo that looks something like this:\n\n About to process 2 users\n \u251c\u2500\u2500\u2500Processing John Doe {username: johndoe, email: }\n \u2502 \u251c\u2500\u2500\u2500Did something with user.\n \u2502 \u2514\u2500\u2500\u2500Finished processing\n \u2514\u2500\u2500\u2500Processing John Smith\n \u251c\u2500\u2500\u2500Did something with user.\n \u251c\u2500\u2500\u2500Starting some_heavy_function.\n \u2502 \u2514\u2500\u2500\u2500....\n \u2514\u2500\u2500\u2500Finished processing\n\nWith this, you get a nice tree structure for your logs in mongo that makes it easier to read the log and trace each function.\n\n**Hint:**\n\nEach branch can, including a simple message, contain any arbitrary information in the data parameter. This accepts any object and is automatically saved with the log entry.\n\n## Getting it to run\n\nIn order to be able to dynamically call treelogger4mongo, you need to have initialized it atlease once somewhere. The treelogger4mongo automatically saves the configuration and allows you to call its static functions.\n\n from treelogger4mongo import Tree\n\n Tree(\"host\", \"port\", \"database\", \"collection\")", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/TheThing/treelogger4mongo", "keywords": null, "license": "WTFPL-2", "maintainer": null, "maintainer_email": null, "name": "treelogger4mongo", "package_url": "https://pypi.org/project/treelogger4mongo/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/treelogger4mongo/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/TheThing/treelogger4mongo" }, "release_url": "https://pypi.org/project/treelogger4mongo/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A logger that logs in a tree structure form in mongo", "version": "0.1.0" }, "last_serial": 813226, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0c4f623253c09b512288f6f603647ffb", "sha256": "0bb42c4cb9d0a48a33d9b833bfc16acdb6609d791cb06399c1061965bcbff223" }, "downloads": -1, "filename": "treelogger4mongo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c4f623253c09b512288f6f603647ffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3427, "upload_time": "2013-07-11T04:50:06", "url": "https://files.pythonhosted.org/packages/41/00/9340053cd4f0f58e9ce327eac3bacf1a1330628adb63dc153cccb66c9e8c/treelogger4mongo-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c4f623253c09b512288f6f603647ffb", "sha256": "0bb42c4cb9d0a48a33d9b833bfc16acdb6609d791cb06399c1061965bcbff223" }, "downloads": -1, "filename": "treelogger4mongo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c4f623253c09b512288f6f603647ffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3427, "upload_time": "2013-07-11T04:50:06", "url": "https://files.pythonhosted.org/packages/41/00/9340053cd4f0f58e9ce327eac3bacf1a1330628adb63dc153cccb66c9e8c/treelogger4mongo-0.1.0.tar.gz" } ] }