{ "info": { "author": "David Krauth", "author_email": "dakrauth@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: System :: Logging", "Topic :: Utilities" ], "description": "======\nprolog\n======\n\nTools and convenience methods to simplify and expedite Python logging.\n\n* Simple - though opinionated - setup for common use-cases\n* Extensively and easily configurable via user and local files, as well as environ variables\n* Comes with full featured formatters and handlers that can also be used\n in normal ``logging`` situations\n\nUsage\n=====\n\n``basic_config``\n----------------\n\nThe easiest way to begin using ``prolog`` is to add the following to your\napplication code::\n\n import prolog\n prolog.basic_config()\n\nThis will configure the ``root`` logger for the default level ``logging.INFO``\nand set up two handlers: a colorized, console streaming handler, as well as a file\nhandler set to log to the default file - ``pypro.log`` - in the main app's directory.\n\nTo specify select loggers defined in application or library code, you pass the\ncomma-seperated names of the desired loggers::\n\n prolog.basic_config('myapp,another_app')\n\n``basic_config`` accepts the following parameters:\n\n\n``loggers``\n The desired loggers to configure; can be either a comma-separated\n string of logger names, a list of ``Logger`` instances, or ``None``\n for the root logger.\n\n``level``\n Specify the logging level for all loggers and handlers. Can be\n either the numeric value or string name for the desired level.\n\n``handlers``\n The handlers to add to the given ``loggers``; can be a comma-separated\n string of shortcut names ('stream' or 'file', by default) or a list\n of ``Handler`` instances.\n\n``propagate``\n Indicates whether each ``logger`` instance will be set to propagte.\n\n``reset_handlers``\n If True, force a reset of all currently configured handlers.\n\n``cfg``\n The ``prolog.config.PrologConfig`` instance to use. If not given,\n the default will be used (``prolog.config.config``). For all\n preceding parameters except for ``loggers`` set to None (the default),\n ``cfg`` will be used to determine the appropriate setting.\n\n\n\nExamples\n--------\n\nOnce installed, **prolog** can be invoked to show configuration settings or\nsample usage::\n\n $ python -m prolog sample --level=DEBUG basic\n\n.. image:: https://raw.githubusercontent.com/dakrauth/prolog/master/resources/basic-output.png\n\nSetting colors via environments variables::\n\n $ export PYPROLOG_LEVEL_COLORS='CRITICAL:white,red;ERROR:lightred;DEBUG:lightgray,cyan;*:gray,gray'\n $ python -m prolog sample --level=DEBUG basic\n\n.. image:: https://raw.githubusercontent.com/dakrauth/prolog/master/resources/env-color-output.png\n\nDevelop and testing\n===================\n\n::\n\n $ pip install invoke\n $ inv develop\n $ inv test\n\nConfiguration\n=============\n\nProlog can be configured via a number of different options:\n\n* User-level configuration file, using ``appdirs`` to determine the user's\n configuration directory plus ``pyprolog/config``, which must be a JSON encoded\n file containing a dictionary overriding any of the defaults listed below\n* Current working directory configuration file ``.pyprologrc``, also JSON\n* Environment variables, see below\n* Manipulation of the default ``prolog.config.config`` instance or instantiating\n your own\n* Generating a ``logging.config.dictConfig`` dict via ``prolog.config.dict_config``\n\nDefaults\n--------\n\n::\n\n LEVEL = 'INFO'\n SHORT_FMT = \"{levelname}:{name} {message}\"\n LONG_FMT = '[{asctime} {name}:{levelname}:{module}:{lineno}] {message}'\n\n COLOR_LONG_FMT = '{color}[{asctime} {name}:{levelname}:{module}:{lineno}]{endcolor} {message}'\n COLOR_SHORT_FMT = '{color}{levelname}:{name}{endcolor} {message}'\n LEVEL_COLORS = 'DEBUG:magenta;INFO:blue;WARNING:yellow;ERROR:red;CRITICAL:white,red'\n\n DATE_FMT = \"%Y-%m-%dT%H:%M:%S\"\n STYLE_FMT = '{'\n\n HANDLERS = 'stream,file'\n PROPAGATE = False\n DISABLE_EXISTING = True\n RESET_HANDLERS = True\n\n STREAM_LEVEL = 'NOTSET'\n STREAM_FORMATTER = 'color'\n STREAM_STREAM = 'sys.stderr'\n\n FILE_LEVEL = 'NOTSET'\n FILE_FORMATTER = 'long'\n FILE_FILENAME = 'pypro.log'\n FILE_MAX_BYTES = 0\n FILE_BACKUP_COUNT = 0\n\nEnvironment\n-----------\n\nBy default, the ``prolog.config.config`` instance will load any environment\nvariable begging with ``PYPROLOG_`` and ending with any of the defaults listed\nabove. For instance, to override the default logging level, do the following\nbefore executing your application code::\n\n $ export PYPROLOG_LEVEL='DEBUG'\n $ python myapp.py\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dakrauth/prolog", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "prolog", "package_url": "https://pypi.org/project/prolog/", "platform": "", "project_url": "https://pypi.org/project/prolog/", "project_urls": { "Homepage": "https://github.com/dakrauth/prolog" }, "release_url": "https://pypi.org/project/prolog/0.3.1/", "requires_dist": [ "appdirs (>=1.4.3)" ], "requires_python": "", "summary": "Simple, robust features for expediting application logging configuration", "version": "0.3.1" }, "last_serial": 3517463, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "1fc03c07b908fea5e02305d27626bc47", "sha256": "a297954379293e58b62da40e3297801fda0a00b84d65691bcc987ef49d1aeebb" }, "downloads": -1, "filename": "prolog-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1fc03c07b908fea5e02305d27626bc47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9344, "upload_time": "2017-09-22T22:15:21", "url": "https://files.pythonhosted.org/packages/69/33/37eff63f647a7e2d23c64fa4bba9381a2b40b990b770dd5327882ac731ff/prolog-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "32a5129a97b1b7e7f7499bca7ec37b30", "sha256": "101d67a599a5d68d934eabc762df3ac14ba0ec393438269911f82746f87e93b0" }, "downloads": -1, "filename": "prolog-0.2.0.tar.gz", "has_sig": false, "md5_digest": "32a5129a97b1b7e7f7499bca7ec37b30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10485, "upload_time": "2017-12-14T16:43:58", "url": "https://files.pythonhosted.org/packages/01/a1/3160900148c9d9a25981c54d90a29fa62454f51fbd340f5c18127f813bc3/prolog-0.2.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "983d5145b45d254a8e086c3aa9669cb7", "sha256": "184e1d4eafa7853be02ed12e2211e71966341206100d1cecdefcf4aca7efabba" }, "downloads": -1, "filename": "prolog-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "983d5145b45d254a8e086c3aa9669cb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13906, "upload_time": "2018-01-24T15:18:13", "url": "https://files.pythonhosted.org/packages/92/6f/f19ba63ea7f40bb48bd85427d18f5a91895ef1c38d5702446b92dd835021/prolog-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ec487b784edc0ae30185c2c47f62046c", "sha256": "f0128f6261490438a3b8abe0415c8792148ee1ea3cff94c28efb9eef8c45859e" }, "downloads": -1, "filename": "prolog-0.3.1.tar.gz", "has_sig": false, "md5_digest": "ec487b784edc0ae30185c2c47f62046c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12213, "upload_time": "2018-01-24T15:18:14", "url": "https://files.pythonhosted.org/packages/69/d4/2e9538432c64cf97357ef59fae70fa217e96ecfed1e856fed84b443e52e0/prolog-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "983d5145b45d254a8e086c3aa9669cb7", "sha256": "184e1d4eafa7853be02ed12e2211e71966341206100d1cecdefcf4aca7efabba" }, "downloads": -1, "filename": "prolog-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "983d5145b45d254a8e086c3aa9669cb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13906, "upload_time": "2018-01-24T15:18:13", "url": "https://files.pythonhosted.org/packages/92/6f/f19ba63ea7f40bb48bd85427d18f5a91895ef1c38d5702446b92dd835021/prolog-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ec487b784edc0ae30185c2c47f62046c", "sha256": "f0128f6261490438a3b8abe0415c8792148ee1ea3cff94c28efb9eef8c45859e" }, "downloads": -1, "filename": "prolog-0.3.1.tar.gz", "has_sig": false, "md5_digest": "ec487b784edc0ae30185c2c47f62046c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12213, "upload_time": "2018-01-24T15:18:14", "url": "https://files.pythonhosted.org/packages/69/d4/2e9538432c64cf97357ef59fae70fa217e96ecfed1e856fed84b443e52e0/prolog-0.3.1.tar.gz" } ] }