{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. -*- mode: rst -*-\n\npyfortified-logging-slim\n-------------------\n\nThis Python project is an extension of the native Python component `logging `_\nproviding more robust message formatting for standard and JSON logging output, and in addtion allowing for extra\ncontent populated as dictionaries.\n\nImportant Note\n^^^^^^^^^^^^^^\n\nThis Python project is a refactoring of `logging-mv-integrations `_\nfor the purpose of general usage intent.\n\nWork In Progress\n^^^^^^^^^^^^^^^^\n\nThe following still needs to be performed for this Python project:\n\n- Unit-testing: This project will be switching over to using Python native Unit testing framework `unittest `_.\n- More concise documentation is required.\n- Travis CI\n- Badges\n\n\nBadges\n------\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n pip install pyfortified_logging_slim\n\n\nArchitecture\n------------\n\n\nFunction: get_logger()\n----------------------\n\n.. code-block:: python\n\n def get_logger(\n logger_name,\n logger_version=None,\n logger_level=logging.INFO,\n logger_format=LoggingFormat.JSON,\n logger_output=LoggingOutput.STDOUT_COLOR,\n logger_handler=None\n ):\n\n\nget_logger(): Parameters\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n| Parameter | Purpose |\n+=================+=========================================================================================================================+\n| logger_name | Return a logger with the specified name or, if name is None, return a logger which is the root logger of the hierarchy. |\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n| logger_version | |\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n| logger_format | LoggingFormat |\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n| logger_output | LoggingOutput |\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n| logger_handler | logging.StreamHandler() or logging.FileHandler() |\n+-----------------+-------------------------------------------------------------------------------------------------------------------------+\n\n\n\nLogging Levels\n^^^^^^^^^^^^^^\n\nSame Python logging levels, including one additional level NOTE.\n\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| Level | Purpose |\n+============+================================================================================================================================================+\n| DEBUG | Detailed information, typically of interest only when diagnosing problems. |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| NOTE | Detailed information, request processing, for example, request using cURL. |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| INFO | Confirmation that things are working as expected. *[DEFAULT]* |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| WARNING | An indication that something unexpected happened, or indicative of some problem in the near future. The software is still working as expected. |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| ERROR | Due to a more serious problem, the software has not been able to perform some function. |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n| CRITICAL | A serious error, indicating that the program itself may be unable to continue running. |\n+------------+------------------------------------------------------------------------------------------------------------------------------------------------+\n\n\n\nLogging Format\n^^^^^^^^^^^^^^\n\n+------------+-------------------------------------------------------------------------------------------------------+\n| Format | Purpose |\n+============+=======================================================================================================+\n| STANDARD | Standard logging format. |\n+------------+-------------------------------------------------------------------------------------------------------+\n| JSON | JSON logging format. *[DEFAULT]* |\n+------------+-------------------------------------------------------------------------------------------------------+\n\n\n.. code-block:: python\n\n class LoggingFormat(object):\n \"\"\"TUNE Logging Format ENUM\n \"\"\"\n STANDARD = \"standard\"\n JSON = \"json\"\n\n\n\nLogging Output\n^^^^^^^^^^^^^^\n\n+--------------+----------------------------------------------------------------------------------------------+\n| Output | Purpose |\n+==============+==============================================================================================+\n| STDOUT | Standard Output to terminal |\n+--------------+----------------------------------------------------------------------------------------------+\n| STDOUT_COLOR | Standard Output using colored terminal |\n+--------------+----------------------------------------------------------------------------------------------+\n| FILE | Standard Output to file created within *./tmp/log_.json*. |\n+--------------+----------------------------------------------------------------------------------------------+\n\n\n.. code-block:: python\n\n class LoggingOutput(object):\n \"\"\"Logging Format ENUM\n \"\"\"\n STDOUT = \"stdout\"\n STDOUT_COLOR = \"color\"\n FILE = \"file\"\n\n\nLogging JSON Format\n^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n import logging\n from pyfortified_logging_slim import (LoggingFormat, get_logger, __version__)\n\n log = get_logger(\n logger_name=__name__,\n logger_version=__version__,\n logger_format=LoggingFormat.JSON,\n logger_level=logging.NOTE\n )\n\n log.info(\"logging: info\", extra={'test': __name__})\n log.note(\"logging: note\", extra={'test': __name__})\n log.debug(\"logging: debug\", extra={'test': __name__})\n log.warning(\"logging: warning\", extra={'test': __name__})\n log.error(\"logging: error\", extra={'test': __name__})\n log.critical(\"logging: critical\", extra={'test': __name__})\n log.exception(\"logging: exception\", extra={'test': __name__})\n\n\nLogging JSON Example Output\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: bash\n\n $ python3 examples/example_logging_json.py\n\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"INFO\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: info\", \"test\": \"__main__\"}\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"NOTE\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: note\", \"test\": \"__main__\"}\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"WARNING\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: warning\", \"test\": \"__main__\"}\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"ERROR\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: error\", \"test\": \"__main__\"}\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"CRITICAL\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: critical\", \"test\": \"__main__\"}\n {\"asctime\": \"2018-05-11 05:41:39 -0700\", \"levelname\": \"ERROR\", \"name\": \"__main__\",\n \"version\": \"0.1.6\", \"message\": \"logging: exception\", \"exc_info\": \"NoneType: None\",\n \"test\": \"__main__\"}\n\n\nRequirements\n------------\n\n``pyfortified-logging-slim`` module is built upon Python 3 and has dependencies upon\nseveral Python modules available within `Python Package Index PyPI `_.\n\n.. code-block:: bash\n\n make install-requirements\n\nor\n\n\n.. code-block:: bash\n\n python3 -m pip uninstall --yes --no-input -r requirements.txt\n python3 -m pip install --upgrade -r requirements.txt\n\n\nDependencies\n^^^^^^^^^^^^\n\n- coloredlogs: https://pypi.python.org/pypi/coloredlogs\n- pprintpp: https://pypi.python.org/pypi/pprintpp\n- python-json-logger: https://pypi.python.org/pypi/python-json-logger\n- Pygments: https://pypi.python.org/pypi/Pygments\n- wheel: https://pypi.python.org/pypi/wheel", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/jeff00seattle/pyfortified-logging/archive/v0.1.10.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jeff00seattle/pyfortified-logging", "keywords": "pyfortified logging", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pyfortified-logging-slim", "package_url": "https://pypi.org/project/pyfortified-logging-slim/", "platform": "", "project_url": "https://pypi.org/project/pyfortified-logging-slim/", "project_urls": { "Download": "https://github.com/jeff00seattle/pyfortified-logging/archive/v0.1.10.tar.gz", "Homepage": "https://github.com/jeff00seattle/pyfortified-logging" }, "release_url": "https://pypi.org/project/pyfortified-logging-slim/0.1.10/", "requires_dist": null, "requires_python": "", "summary": "Extension to Python `logging` functionality.", "version": "0.1.10" }, "last_serial": 4439750, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "037df77b3fc0fd8167a57d5a9b7784f3", "sha256": "a1ce92934ca83a1f88c50cf09bc1669523bed4a70454a885dc60701cabbc3c1f" }, "downloads": -1, "filename": "pyfortified-logging-slim-0.1.10.tar.gz", "has_sig": false, "md5_digest": "037df77b3fc0fd8167a57d5a9b7784f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30487, "upload_time": "2018-11-01T07:45:58", "url": "https://files.pythonhosted.org/packages/62/49/d733e9265edebb93e15335306eaf7d797c77a928d251a4f65802311f7d60/pyfortified-logging-slim-0.1.10.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "037df77b3fc0fd8167a57d5a9b7784f3", "sha256": "a1ce92934ca83a1f88c50cf09bc1669523bed4a70454a885dc60701cabbc3c1f" }, "downloads": -1, "filename": "pyfortified-logging-slim-0.1.10.tar.gz", "has_sig": false, "md5_digest": "037df77b3fc0fd8167a57d5a9b7784f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30487, "upload_time": "2018-11-01T07:45:58", "url": "https://files.pythonhosted.org/packages/62/49/d733e9265edebb93e15335306eaf7d797c77a928d251a4f65802311f7d60/pyfortified-logging-slim-0.1.10.tar.gz" } ] }