{ "info": { "author": "Jason Dusek", "author_email": "jason.dusek@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Software Development" ], "description": "============\n``magiclog``\n============\n\n.. image:: https://travis-ci.org/drcloud/magiclog.svg?branch=master\n :target: https://travis-ci.org/drcloud/magiclog\n.. image:: https://img.shields.io/pypi/v/magiclog.svg\n :target: https://pypi.python.org/pypi/magiclog\n.. image:: https://img.shields.io/pypi/dd/magiclog.svg\n :target: https://pypi.python.org/pypi/magiclog\n\n``magiclog`` simplifies application and library logging, allowing you to use\nloggers where you would use print statements without complicated setup or\nlogger discovery.\n\n.. code:: python\n\n from magiclog import log\n\n\n def main():\n log.configure()\n log.info('Hello, INFO.')\n\n\n if __name__ == '__main__':\n main()\n\n``magiclog`` tunes the logging config in a way that's friendlier than the\n``logging`` module's basic config, without asking any more work from the\nlibrary author:\n\n* ``from magiclog import log`` retrieves the logger for your application, using\n a little meta-programming, obviating the need to figure whether you should\n use ``__package__``, ``__name__`` or the ``sys.argv[0]``.\n\n* When you're running your task in the background, ``magiclog`` recognizes\n this and logs to Syslog; otherwise it logs to ``stderr``.\n\n* ``magiclog`` provides a simply one-line format for ``stderr``, with the time\n and a message, but can also log in an extended format, with logging and\n level, when requested. And ``magiclog`` always includes this information when\n logging to Syslog.\n\n``magiclog`` only arranges to log at all when you call ``log.configure()``.\nIf you'd like to customize levels, you can explicitly pass them to\n``log.configure()`` with the ``level=...``, ``syslog=...`` and ``stderr=...``\nnamed parameters. Otherwise, your logger has a null handler, as described in\n`Configuring Logging for a Library`_\n\n.. _`Configuring Logging for a Library`: https://docs.python.org/2/howto/logging.html#configuring-logging-for-a-library\n\n.. code:: python\n\n log.configure()\n\n # Same as the above.\n log.configure(level='info')\n\n # Use Syslog or stderr based on whether or not we're in the foreground,\n # but at debug level instead of info level.\n log.configure(level='debug')\n\n # Enables both channels, whether foregrounded or backgrounded.\n log.configure(syslog='info', stderr='info')\n\n # Enables the more verbose console logging format, with module and function\n # name information as well as time.\n log.configure(level='info', extended=True)\n\n\n----------------------------------\nConfiguring Other Modules' Loggers\n----------------------------------\n\nThe ``logger`` function in ``magiclog`` provides for logger discovery, walking\nthe stack and using the module or package name, or the name of the running\nexecutable, depending on the situation. You can use ``logger`` to retrieve and\nconfigure the loggers of other modules, too, following the same rules as your\napplication logger.\n\n.. code:: python\n\n import magiclog\n from magiclog import log\n\n\n def main():\n # You can pass a module object or a string to ``logger``. Here, we\n # configure magiclog's own (usually not very useful) logger.\n magiclog.logger(magiclog).configure()\n # Obtain a reference to Boto3's logger and auto-configure it. The\n # logger for ``magiclog`` will print out a few things as it sets this\n # logger up.\n magiclog.logger('boto3').configure()\n log.configure()\n log.info('Hello, INFO.')\n\n\n if __name__ == '__main__':\n main()\n", "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/drcloud/magiclog", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "magiclog", "package_url": "https://pypi.org/project/magiclog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/magiclog/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/drcloud/magiclog" }, "release_url": "https://pypi.org/project/magiclog/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Easy logger management for libraries and CLI tools.", "version": "1.0.2" }, "last_serial": 2425258, "releases": { "0.99.2": [ { "comment_text": "", "digests": { "md5": "f605cd9337dda8483a98e4fd0a91a9c8", "sha256": "b4b3c31c71c3ce4658158b68ec696ae9d39c1062978de66e919fdeddd65276e1" }, "downloads": -1, "filename": "magiclog-0.99.2.tar.gz", "has_sig": false, "md5_digest": "f605cd9337dda8483a98e4fd0a91a9c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5231, "upload_time": "2016-04-09T09:33:15", "url": "https://files.pythonhosted.org/packages/6e/79/484e9a20b85269a8eac54c621497508735a2d090d7f54dba774e6936785e/magiclog-0.99.2.tar.gz" } ], "0.99.3": [ { "comment_text": "", "digests": { "md5": "05a7cf19458b35c4ea090026c362d000", "sha256": "8bc8389c2c60889d0d84421efa88f1fa4953e52300342da75247a8c77485b515" }, "downloads": -1, "filename": "magiclog-0.99.3.tar.gz", "has_sig": false, "md5_digest": "05a7cf19458b35c4ea090026c362d000", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5093, "upload_time": "2016-05-19T05:41:52", "url": "https://files.pythonhosted.org/packages/51/33/6488c358d6995e908f6b5e20359a47588f96ded40eee1fc1b4279b5c441e/magiclog-0.99.3.tar.gz" } ], "0.99.4": [ { "comment_text": "", "digests": { "md5": "a64f41c12fe1114d93dc41bc94fd8cd7", "sha256": "32f13a5990a3984855dd9c8fd8c44f7d0398440505844de503f0aaa447daeb02" }, "downloads": -1, "filename": "magiclog-0.99.4.tar.gz", "has_sig": false, "md5_digest": "a64f41c12fe1114d93dc41bc94fd8cd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5084, "upload_time": "2016-05-24T05:20:19", "url": "https://files.pythonhosted.org/packages/86/6d/ca3d5a5d222ea3f5ef16f97454ff255405f75d0f41804e478538105c150b/magiclog-0.99.4.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "8b9bd482579687a1ad3afee6da2dfc7d", "sha256": "ca33bb9f8ae7c87e45bade611f2230b788dd408e75e745d0ff94356a096df7a0" }, "downloads": -1, "filename": "magiclog-1.0.2.tar.gz", "has_sig": false, "md5_digest": "8b9bd482579687a1ad3afee6da2dfc7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5161, "upload_time": "2016-10-27T01:47:30", "url": "https://files.pythonhosted.org/packages/bf/dc/91c28a511c82bec1e798f04177fb311a708622a6100de36ea1ba8f2dccf0/magiclog-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8b9bd482579687a1ad3afee6da2dfc7d", "sha256": "ca33bb9f8ae7c87e45bade611f2230b788dd408e75e745d0ff94356a096df7a0" }, "downloads": -1, "filename": "magiclog-1.0.2.tar.gz", "has_sig": false, "md5_digest": "8b9bd482579687a1ad3afee6da2dfc7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5161, "upload_time": "2016-10-27T01:47:30", "url": "https://files.pythonhosted.org/packages/bf/dc/91c28a511c82bec1e798f04177fb311a708622a6100de36ea1ba8f2dccf0/magiclog-1.0.2.tar.gz" } ] }