{ "info": { "author": "John Richardson", "author_email": "jmrichardson@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "========\nLog Plus\n========\n\n\n.. image:: https://img.shields.io/pypi/v/logplus.svg\n :target: https://pypi.python.org/pypi/logplus\n\n.. image:: https://img.shields.io/travis/jmrichardson/logplus.svg\n :target: https://travis-ci.org/jmrichardson/logplus\n\n.. image:: https://readthedocs.org/projects/logplus/badge/?version=latest\n :target: https://logplus.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n\n\nEasy python logging wrapper to use best pracitces, reduce code and add additional fields.\n\nLog Plus overview:\n\n* Provide permanent and ephimeral context fields in each log entry\n* Provide a simple way to consistently log with best practices\n* Avoid cumbersome boiler plate code across each application\n* Configure python logging using a simple YAML file\n* Simple and clean usage\n* Free software: MIT license\n* Documentation: https://logplus.readthedocs.io.\n* Python >= 3.5\n\nFeatures\n--------\n\nInspired by `Python logging best practices with JSON steirods `_.\n\n* Utilizes standard python loggging\n* Uses YAML logging configuration file\n* Logs in JSON format\n* Add permanent and ephemeral context fields\n\nQuick Start\n-----------\n\nInstall logplus\n\n.. code:: python\n\n pip install logplus\n\nImport logplus package\n\n.. code:: python\n\n import logplus\n\nDefine logger with log file location and permanent context fields. Permanent context fields are static and will be added to all log entries. For example, you may want to log the arguments provided to the script as well as an instance identifier (uuid)\n\n.. code:: python\n\n log = logplus.setup('test.log', arg1=arg1, uuid=uuid)\n\nAdd a log entry. The log entry will contain the previous arguments as well as the field \"count\" with the value of count.\n\n.. code:: python\n\n log.info(\"Application message\", count=count)\n\nHere is a simple application example test.py\n\n.. code:: python\n\n import logplus\n\n arg1 = \"argument1\"\n uuid = \"23RS2F\"\n log = logplus.setup('test.log', arg1=arg1, uuid=uuid)\n count = 1\n log.info(\"Application message: with count\", count=count)\n log.info(\"Application message: no count\")\n\nWhich resulted in the following log entries in \"test.log\"::\n\n {\"asctime\": \"2018-08-22 16:51:28,794\", \"filename\": \"test.py\", \"lineno\": 7, \"levelname\": \"INFO\", \"message\": \"Application message: with count\", \"arg1\": \"argument1\", \"uuid\": \"23RS2F\", \"count\": 1}\n {\"asctime\": \"2018-08-22 16:51:28,795\", \"filename\": \"test.py\", \"lineno\": 8, \"levelname\": \"INFO\", \"message\": \"Application message: no count\", \"arg1\": \"argument1\", \"uuid\": \"23RS2F\"}\n\n\nUsage\n-----\n\nLog Plus requires a simple configuration command to set the log file location, optional logging configurational file and any context fields to be added to all log entries::\n\n\tlogplus.setup(log_file, [config_file], [static_args]...)\n\n* **log_file**: Path of log file to write to\n* **config_file**: Optional logging configuration file in YAML format\n* **static_args**: Key value arguments to be included in all log entries\n\nNote that if a configuration file is not supplied, it will use the following configuration::\n\n ---\n\tversion: 1\n\tdisable_existing_loggers: False\n\tformatters:\n \tsimple:\n \tformat: \"%(asctime)s - %(levelname)s - %(message)s\"\n \tjson:\n \tformat: \"%(asctime)s %(filename)s %(lineno)s %(levelname)s %(message)s\"\n \tclass: pythonjsonlogger.jsonlogger.JsonFormatter\n\n\thandlers:\n \tconsole:\n \tclass: logging.StreamHandler\n \tlevel: DEBUG\n \tformatter: simple\n \tstream: ext://sys.stdout\n\n \tfile_handler:\n \tclass: logging.handlers.RotatingFileHandler\n \tformatter: json\n \tmaxBytes: 10485760 # 10MB\n \tbackupCount: 20\n \tencoding: utf8\n\n\troot:\n \tlevel: INFO\n \thandlers: [console, file_handler]\n\t...\n\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\n0.1.0 (2018-08-20)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jmrichardson/logplus", "keywords": "logplus", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "logplus", "package_url": "https://pypi.org/project/logplus/", "platform": "", "project_url": "https://pypi.org/project/logplus/", "project_urls": { "Homepage": "https://github.com/jmrichardson/logplus" }, "release_url": "https://pypi.org/project/logplus/0.1.15/", "requires_dist": [ "pyyaml", "python-json-logger" ], "requires_python": "", "summary": "Easy python logging wrapper to use best pracitces, reduce code and add additional fields", "version": "0.1.15" }, "last_serial": 4200387, "releases": { "0.1.13": [ { "comment_text": "", "digests": { "md5": "e14dce260e40b7ba0cb724410a3b23e8", "sha256": "5937fc2f178df3951cfbf27f70fe0714c2bb5af74ddc787b3a018850cd2d3451" }, "downloads": -1, "filename": "logplus-0.1.13-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e14dce260e40b7ba0cb724410a3b23e8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5239, "upload_time": "2018-08-22T21:32:38", "url": "https://files.pythonhosted.org/packages/97/49/f8582b6e60c802271eb753e5692fc5fa7d620613ac43961bc5bb3777a07f/logplus-0.1.13-py2.py3-none-any.whl" } ], "0.1.15": [ { "comment_text": "", "digests": { "md5": "9849e6ed74090b3f4732879033b89334", "sha256": "b9748162ff2a10f72e8155c89d323b4eeedf8f65ba6d0ce759aa51287b5ed1a3" }, "downloads": -1, "filename": "logplus-0.1.15-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9849e6ed74090b3f4732879033b89334", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5243, "upload_time": "2018-08-23T15:29:38", "url": "https://files.pythonhosted.org/packages/0d/26/870d77ccb82662859382d4961da8888b6787110bd873dfd257cfd1ef2bf9/logplus-0.1.15-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9849e6ed74090b3f4732879033b89334", "sha256": "b9748162ff2a10f72e8155c89d323b4eeedf8f65ba6d0ce759aa51287b5ed1a3" }, "downloads": -1, "filename": "logplus-0.1.15-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9849e6ed74090b3f4732879033b89334", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5243, "upload_time": "2018-08-23T15:29:38", "url": "https://files.pythonhosted.org/packages/0d/26/870d77ccb82662859382d4961da8888b6787110bd873dfd257cfd1ef2bf9/logplus-0.1.15-py2.py3-none-any.whl" } ] }