{ "info": { "author": "ShuFeng Ying", "author_email": "me@yingsf.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: Chinese (Simplified)", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: Unix", "Programming Language :: Python :: 3 :: Only" ], "description": "## ylog\n\n[![License](https://img.shields.io/badge/License-MIT-red.svg)]()\n[![OS](https://img.shields.io/badge/OS-MacOS%2C%20Linux-brightgreen.svg)]()\n[![Python](https://img.shields.io/badge/Python-3.6.5-blue.svg)]()\n[![Pypi](https://img.shields.io/pypi/wheel/Django.svg)]()\n[![version](https://img.shields.io/badge/Version-0.0.2-yellow.svg)]()\n\nSimple and effective logging for Python 3, easy logging to console or rotating file or socket\n\n### Install\n\n```bash\npip install ylog\n```\n\n### Example Usage\n\n```bash\n# Default Stream or File Handler Format Is:\n'[%(asctime)s %(name)s %(module)s:%(lineno)d %(levelname)s] %(message)s'\n\n# Default Socket Handler Format Is:\n'[%(asctime)s %(ip)s:%(name)s %(module)s:%(lineno)d %(levelname)s] %(message)s'\n\n# Default Date Format Is:\n'%Y-%m-%d %H:%M:%S'\n```\n\n#### 1. Stream Logger\n\n```bash\nimport ylog\n\nlogger = ylog.getConsoleLogger('loggerName')\n\nlogger.info('Hello')\n\n# show\n[2018-06-07 12:50:35 ylog :1 INFO] The StreamHandler is working\n```\n\n#### 2. File Logger\n\nRotating log files by date and size:\n\n - If the file size is reached (default 100M) but the split date is not reached, then the existing log file (for example, app.log) is backed up as app.log.x( x from 1 to n).\n \n - If the split date is reached, rename all log files (including app.log.x) with a timestamp. For example, app.log-1979-02-19-13:33:16.1\n\n```bash\nimport ylog\n\nlogger = ylog.getFileLogger('./demo.log')\n\nlogger.info('The fileHandler is working, no logger name')\n\n# show\n[2018-06-07 12:56:29 ylog :1 INFO] The fileHandler is working, no logger name\n\n# ---------------------- #\n\nlogger2 = ylog.getFileLogger('./demo.log', loggerName='demoLogger', size=200, date='y')\n\nlogger2.info('Files will be split after reaching 200M and 1 year')\n\n# show\n[2018-06-07 13:00:24 demoLogger :1 INFO] Files will be split after reaching 200M and 1 year\n```\n\n#### 3. Socket Logger\n\n> ylog SocketHandler is mainly used with `pylogserver`. When pylogserver is available, logs are sent to pylogserver in real time. When pylogserver is not available, logs are cached locally and automatically sent when communication is restored.\n\n_Visit [pylogserver](https://github.com/yingsf/pylogserver) for more details on pylogserver_\n\nWhen loggerName contains `||`, pylogserver will use the characters before `||` as the directory name, and the characters after `||` as the log file name. The following is the location of the log file on the pylogserver server.\n\n```bash\nimport ylog\n\n# './buff' is the local log cache directory\nlogger = ylog.getSocketLogger('ylog||test', '127.0.0.1', 7000, './buff')\n\nlogger.info('Send log to pylogserver')\n\n$ tree\n.\n\u2514\u2500\u2500 ylog\n \u2514\u2500\u2500 test.log\n\n$ cat test.log\n\n[2018-06-07 13:16:04 61.180.150.242:test :1 INFO] Send log to pylogserver\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/yingsf//tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yingsf/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ylog", "package_url": "https://pypi.org/project/ylog/", "platform": "MacOS", "project_url": "https://pypi.org/project/ylog/", "project_urls": { "Download": "https://github.com/yingsf//tarball/master", "Homepage": "https://github.com/yingsf/" }, "release_url": "https://pypi.org/project/ylog/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Easy logging to console or rotating file or socket for Python 3.", "version": "0.0.3" }, "last_serial": 3952998, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "a76fa957ec5306cdbdac286844f9e39a", "sha256": "74172c0affa176d1d0cf5ce5cc0041ce07e8b18052f729c11b483ac71119df72" }, "downloads": -1, "filename": "ylog-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a76fa957ec5306cdbdac286844f9e39a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 10283, "upload_time": "2018-06-07T06:49:12", "url": "https://files.pythonhosted.org/packages/c6/55/c3a597747ca3e629eaa5be4b8d41aeaa4cf216fb4cf98002185b14cc6e15/ylog-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "140d5e6b413880ef045cdd0275731c74", "sha256": "f9fa6dc78c7f0672166b8148472b21fe1b98d6f76bc21b2cc40fa430699d675a" }, "downloads": -1, "filename": "ylog-0.0.2.tar.gz", "has_sig": false, "md5_digest": "140d5e6b413880ef045cdd0275731c74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9754, "upload_time": "2018-06-07T06:49:04", "url": "https://files.pythonhosted.org/packages/a0/6e/e2a9f8e7ce24aeb90fecdead607e770f1dd41c372bb8144c0772c654a172/ylog-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f7efd3ba1b28210ced23df4c5ccf8826", "sha256": "49b9ac585dfe6677f88d351312acf7c8276cc57ef94abbfa17163f3105f8eb14" }, "downloads": -1, "filename": "ylog-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f7efd3ba1b28210ced23df4c5ccf8826", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8236, "upload_time": "2018-06-12T07:41:18", "url": "https://files.pythonhosted.org/packages/aa/c8/9a49f7ef8d48b7b04f0c00feb367cac4bd7cc7583a1acfdd5ab05ad94f70/ylog-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afa111f917d337f56897fd61e543a9f5", "sha256": "d1ece64661692cfc5ac5512d81f566607da6571b6b30838d16bc9869ed9d5870" }, "downloads": -1, "filename": "ylog-0.0.3.tar.gz", "has_sig": false, "md5_digest": "afa111f917d337f56897fd61e543a9f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9740, "upload_time": "2018-06-12T07:41:16", "url": "https://files.pythonhosted.org/packages/4d/2e/0899679fa6e4526c32bc0945f9bdae9cd0b36f1d29dcd3b2192540029ffc/ylog-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7efd3ba1b28210ced23df4c5ccf8826", "sha256": "49b9ac585dfe6677f88d351312acf7c8276cc57ef94abbfa17163f3105f8eb14" }, "downloads": -1, "filename": "ylog-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f7efd3ba1b28210ced23df4c5ccf8826", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8236, "upload_time": "2018-06-12T07:41:18", "url": "https://files.pythonhosted.org/packages/aa/c8/9a49f7ef8d48b7b04f0c00feb367cac4bd7cc7583a1acfdd5ab05ad94f70/ylog-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "afa111f917d337f56897fd61e543a9f5", "sha256": "d1ece64661692cfc5ac5512d81f566607da6571b6b30838d16bc9869ed9d5870" }, "downloads": -1, "filename": "ylog-0.0.3.tar.gz", "has_sig": false, "md5_digest": "afa111f917d337f56897fd61e543a9f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9740, "upload_time": "2018-06-12T07:41:16", "url": "https://files.pythonhosted.org/packages/4d/2e/0899679fa6e4526c32bc0945f9bdae9cd0b36f1d29dcd3b2192540029ffc/ylog-0.0.3.tar.gz" } ] }