{ "info": { "author": "MIT ODL Engineering", "author_email": "odl-engineering@mit.edu", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-Log\r\n---------\r\n\r\n.. image:: https://img.shields.io/travis/mitodl/flask-log.svg\r\n :target: https://travis-ci.org/mitodl/flask-log\r\n.. image:: https://img.shields.io/coveralls/mitodl/flask-log.svg\r\n :target: https://coveralls.io/r/mitodl/flask-log\r\n.. image:: https://img.shields.io/github/issues/mitodl/flask-log.svg\r\n :target: https://github.com/mitodl/flask-log/issues\r\n.. image:: https://img.shields.io/badge/license-BSD-blue.svg\r\n :target: https://github.com/mitodl/flask-log/blob/master/LICENSE\r\n\r\nThis is a handy flask extension for setting up logging for your\r\napplication that is super simple to setup. A basic example is:\r\n\r\n.. code-block:: python\r\n\r\n import flask\r\n from flask.ext.log import Logging\r\n\r\n app = flask.Flask(__name__)\r\n app.config['FLASK_LOG_LEVEL'] = 'DEBUG'\r\n flask_log = Logging(app)\r\n \r\n\r\n app.logger.debug('Testing a debug message')\r\n\r\nSo the level of logging is configurable through regular flask\r\nconfiguration methods. Additionally, since we are setting up the root\r\nlogger, you can use whatever logger you want as you aren't restricted\r\nto the flask application logger. i.e. something like:\r\n\r\n.. code-block:: python\r\n\r\n import logging\r\n\r\n log = logging.getLogger('my-special-logger')\r\n log.critical('Oh my!')\r\n\r\nwill also keep the formatter and level if the extensions has been\r\ninitialized anywhere.\r\n\r\nFeatures\r\n========\r\n\r\n- Sets up syslog handling to either ``/dev/log``, ``/var/run/syslog``,\r\n or ``127.0.0.1`` on UDP port 514 depending on what is available.\r\n- Adds a log formatter packed with information and by default produces\r\n output like: ``[2015-03-31 18:10:17,816] CRITICAL 42282 [__main__]\r\n example.py:7 - [my_hostname] - Hi``\r\n- Full code coverage\r\n- The log formatter can be overidden with something like:\r\n\r\n .. code-block:: python\r\n\r\n flask_logger = Logging(app)\r\n flask_logger.set_formatter('Log message follows: %(message)s')\r\n\r\nLinks\r\n`````\r\n\r\n- `documentation `_\r\n- `development version `_", "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/mitodl/flask-log", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "flask-log", "package_url": "https://pypi.org/project/flask-log/", "platform": "any", "project_url": "https://pypi.org/project/flask-log/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mitodl/flask-log" }, "release_url": "https://pypi.org/project/flask-log/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Configure logging in flask applications", "version": "0.1.0" }, "last_serial": 1493397, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1356c1b86e13a48c040bf448d4571584", "sha256": "e708570519f8c50d12b398c0c49a43e1c69b4298dae28c326a7aa4becad5a44c" }, "downloads": -1, "filename": "flask-log-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1356c1b86e13a48c040bf448d4571584", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4042, "upload_time": "2015-04-06T22:11:16", "url": "https://files.pythonhosted.org/packages/b4/64/b0907045c9cf0f8850118739e3b3061a546dae2a6fafd3e6c26e594eaba8/flask-log-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1356c1b86e13a48c040bf448d4571584", "sha256": "e708570519f8c50d12b398c0c49a43e1c69b4298dae28c326a7aa4becad5a44c" }, "downloads": -1, "filename": "flask-log-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1356c1b86e13a48c040bf448d4571584", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4042, "upload_time": "2015-04-06T22:11:16", "url": "https://files.pythonhosted.org/packages/b4/64/b0907045c9cf0f8850118739e3b3061a546dae2a6fafd3e6c26e594eaba8/flask-log-0.1.0.tar.gz" } ] }