{ "info": { "author": "Christopher H. Todd", "author_email": "Christopher.Hayden.Todd@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# Christopher H. Todd's Python Library For Configuring Logging\n\nThe ctodd-python-lib-logging project is responsible for configuring the logging for python scripts. Will set up the level, format of the messages, and the stream.\n\n## Table of Contents\n\n- [Dependencies](#dependencies)\n- [Libraries](#libraries)\n- [Example Scripts](#example-scripts)\n- [Notes](#notes)\n- [TODO](#todo)\n\n## Dependencies\n\n### Python Packages\n\n- N/A\n\n## Libraries\n\n### [loggers.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-logging/blob/master/logging_helpers/loggers.py)\n\nLibrary for getting loggers of specific configurations in Python. This will utilize Pythons built-in logging library and will return an instance of logging that can be implemented in any code that already implements the logging class.\n\nFunctions:\n\n```\ndef get_stdout_logging(\n log_level=logging.INFO,\n log_msg_fmt=\"%(asctime)s.%(msecs)03d %(levelname)s %(message)s\",\n log_date_fmt=\"%a, %d %b %Y %H:%M:%S\",\n log_prefix=None,\n):\n \"\"\"\n Purpose:\n Get Logger to standard out.\n Args:\n log_level (log level from logging): Minimum level for messages to log\n log_msg_fmt (String): Mesage format for all logs with variable\n substitution for known logging options\n log_date_fmt (Stringg): Dateformat to append to message\n log_prefix (String): prefix to append to message\n Return:\n logging (Python logging object): Configured logging object\n Examples:\n >>> logging = get_stdout_logging()\n or\n >>> logging =\\\n get_stdout_logging(\n log_level=logging.DEBUG,\n log_prefix='[test_script]: '',\n )\n \"\"\"\n```\n\n```\ndef get_file_logger(\n log_file=None,\n log_filemode=\"a\",\n log_level=logging.INFO,\n log_msg_fmt=\"%(asctime)s %(levelname)s %(message)s\",\n log_date_fmt=\"%a, %d %b %Y %H:%M:%S\",\n log_prefix=None,\n):\n \"\"\"\n Purpose:\n Get Logger to file\n Args:\n log_level (log level from logging): Minimum level for messages to log\n log_msg_fmt (String): Mesage format for all logs with variable\n substitution for known logging options\n log_date_fmt (Stringg): Dateformat to append to message\n log_prefix (String): prefix to append to message\n Return:\n logging (Python logging object): Configured logging object\n Examples:\n >>> logging = get_file_logger()\n or\n >>> logging =\\\n get_file_logger(\n log_level=logging.ERROR,\n prefix='[test_script]: '',\n log_file='./script_im_writing.log'\n )\n \"\"\"\n```\n\n```\ndef clear_log_handlers():\n \"\"\"\n Purpose:\n Remove previous log handlers and configurations. This\n will ensure that any new logging that is configured\n will take precedence, as logging is first setting\n is not overwritten.\n Args:\n N/A\n Return:\n N/A\n \"\"\"\n```\n\n## Example Scripts\n\nExample executable Python scripts/modules for testing and interacting with the library. These show example use-cases for the libraries and can be used as templates for developing with the libraries or to use as one-off development efforts.\n\n### [example_stdout_logger.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-logging/blob/master/example_usage/example_stdout_logger.py)\n\n```\nExample Logger. Configure to Output to CLI\n```\n\n## Notes\n\n - Relies on f-string notation, which is limited to Python3.6. A refactor to remove these could allow for development with Python3.0.x through 3.5.x\n\n## TODO\n\n - Unittest framework in place, but lacking tests\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChristopherHaydenTodd/ctodd-python-lib-logging", "keywords": "python,libraries,logging,loggers", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ctodd-python-lib-logging", "package_url": "https://pypi.org/project/ctodd-python-lib-logging/", "platform": "", "project_url": "https://pypi.org/project/ctodd-python-lib-logging/", "project_urls": { "Homepage": "https://github.com/ChristopherHaydenTodd/ctodd-python-lib-logging" }, "release_url": "https://pypi.org/project/ctodd-python-lib-logging/1.0.0/", "requires_dist": null, "requires_python": ">3.6", "summary": "Python utilities used for logging", "version": "1.0.0" }, "last_serial": 5170281, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "181be06b8a502be2442e16bb959d5bca", "sha256": "426fa3d6facecbb12a163c0df531b1bba8354225a94e13808af2073dbd777790" }, "downloads": -1, "filename": "ctodd_python_lib_logging-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "181be06b8a502be2442e16bb959d5bca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 5544, "upload_time": "2019-04-21T17:04:17", "url": "https://files.pythonhosted.org/packages/f0/3d/4843657edacab9dc5ddc06aa2d7eebfd3369179d9c8f7503ccb78a7b5bed/ctodd_python_lib_logging-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a1b13bb2091b1badd614c4bb8256a78", "sha256": "a009c9a5e7d1630f72233dbfb7dbaccfe79dc73dd188f808e4a6ccd752151bb6" }, "downloads": -1, "filename": "ctodd-python-lib-logging-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8a1b13bb2091b1badd614c4bb8256a78", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 5233, "upload_time": "2019-04-21T17:04:19", "url": "https://files.pythonhosted.org/packages/ba/54/aeb938deb32ecf7e4b41a36d7df130569ae08c29523ac9f9a8b9ebf8045a/ctodd-python-lib-logging-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "181be06b8a502be2442e16bb959d5bca", "sha256": "426fa3d6facecbb12a163c0df531b1bba8354225a94e13808af2073dbd777790" }, "downloads": -1, "filename": "ctodd_python_lib_logging-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "181be06b8a502be2442e16bb959d5bca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 5544, "upload_time": "2019-04-21T17:04:17", "url": "https://files.pythonhosted.org/packages/f0/3d/4843657edacab9dc5ddc06aa2d7eebfd3369179d9c8f7503ccb78a7b5bed/ctodd_python_lib_logging-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a1b13bb2091b1badd614c4bb8256a78", "sha256": "a009c9a5e7d1630f72233dbfb7dbaccfe79dc73dd188f808e4a6ccd752151bb6" }, "downloads": -1, "filename": "ctodd-python-lib-logging-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8a1b13bb2091b1badd614c4bb8256a78", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 5233, "upload_time": "2019-04-21T17:04:19", "url": "https://files.pythonhosted.org/packages/ba/54/aeb938deb32ecf7e4b41a36d7df130569ae08c29523ac9f9a8b9ebf8045a/ctodd-python-lib-logging-1.0.0.tar.gz" } ] }