fly_log
========
最简单的日志,比 print 函数,多了时间与源文件信息。用于比较小的python项目,是适合的。
`from fly_log import debug_print as print, log_time, set_log_to_file `
特点
========
功能简单,小的程序非常适用
与print函数一致,如果影响效率,注释掉相应的代码
@log_time 打印函数运行的时间,如果影响效率,注释掉相应的代码
安装说明
=======
代码对 Python 3 兼容
* 全自动安装:`pip install fly-log` / `pip3 install fly-log`
代码示例
```python
from fly_log import debug_print as print
import time
def test1():
print("my fly log ")
@log_time
def test2():
time.sleep(0.5)
def test3():
set_log_to_file("logs/a.log")
print("aaa")
test1()
test2()
# 输出这样的格式
# 2023-03-26 19:50:04.338 test1(fly_log_sample_dev_run.py:6) my fly log
# 2023-03-26 19:50:04.843 test2() (fly_log_sample_dev_run.py:15) time cost 0.504 sec
```
Raw data
{
"_id": null,
"home_page": "https://github.com/zero-space-man-community/fly_log",
"name": "fly-log",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "fly log debug",
"author": "flythinker",
"author_email": "flythinker@qq.com",
"download_url": "https://files.pythonhosted.org/packages/58/78/7a454eff83af32206e841376f8fdd41ffd3d3fdab4c0107c453b5c3d867b/fly_log-0.3.1.tar.gz",
"platform": "any",
"description": "fly_log\r\n========\r\n\r\n\u6700\u7b80\u5355\u7684\u65e5\u5fd7\uff0c\u6bd4 print \u51fd\u6570\uff0c\u591a\u4e86\u65f6\u95f4\u4e0e\u6e90\u6587\u4ef6\u4fe1\u606f\u3002\u7528\u4e8e\u6bd4\u8f83\u5c0f\u7684python\u9879\u76ee\uff0c\u662f\u9002\u5408\u7684\u3002\r\n\r\n`from fly_log import debug_print as print, log_time, set_log_to_file `\r\n\r\n\u7279\u70b9\r\n========\r\n \u529f\u80fd\u7b80\u5355\uff0c\u5c0f\u7684\u7a0b\u5e8f\u975e\u5e38\u9002\u7528\r\n \u4e0eprint\u51fd\u6570\u4e00\u81f4\uff0c\u5982\u679c\u5f71\u54cd\u6548\u7387\uff0c\u6ce8\u91ca\u6389\u76f8\u5e94\u7684\u4ee3\u7801\r\n @log_time \u6253\u5370\u51fd\u6570\u8fd0\u884c\u7684\u65f6\u95f4\uff0c\u5982\u679c\u5f71\u54cd\u6548\u7387\uff0c\u6ce8\u91ca\u6389\u76f8\u5e94\u7684\u4ee3\u7801\r\n\r\n\u5b89\u88c5\u8bf4\u660e\r\n=======\r\n\r\n\u4ee3\u7801\u5bf9 Python 3 \u517c\u5bb9\r\n\r\n* \u5168\u81ea\u52a8\u5b89\u88c5\uff1a`pip install fly-log` / `pip3 install fly-log`\r\n\r\n\u4ee3\u7801\u793a\u4f8b\r\n \r\n```python\r\nfrom fly_log import debug_print as print\r\nimport time \r\n\r\ndef test1():\r\n print(\"my fly log \") \r\n\r\n@log_time \r\ndef test2():\r\n time.sleep(0.5) \r\n\r\ndef test3():\r\n set_log_to_file(\"logs/a.log\")\r\n print(\"aaa\") \r\n\r\ntest1()\r\ntest2()\r\n\r\n# \u8f93\u51fa\u8fd9\u6837\u7684\u683c\u5f0f\r\n# 2023-03-26 19:50:04.338 test1(fly_log_sample_dev_run.py:6) my fly log \r\n# 2023-03-26 19:50:04.843 test2() (fly_log_sample_dev_run.py:15) time cost 0.504 sec \r\n```\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "a simple log for small project",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/zero-space-man-community/fly_log"
},
"split_keywords": [
"fly",
"log",
"debug"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "79c33fd52f98e7cd51a1f4da52efac3639f5a58c3f0c945c336ffa716578f62f",
"md5": "d5f68a57d40b678358a19a353d2d554e",
"sha256": "315726a233437fdfa5ea52cf4fadff29b3011937fbe7e3c9fab609c07eea16ca"
},
"downloads": -1,
"filename": "fly_log-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d5f68a57d40b678358a19a353d2d554e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4317,
"upload_time": "2023-12-06T06:04:57",
"upload_time_iso_8601": "2023-12-06T06:04:57.644523Z",
"url": "https://files.pythonhosted.org/packages/79/c3/3fd52f98e7cd51a1f4da52efac3639f5a58c3f0c945c336ffa716578f62f/fly_log-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "58787a454eff83af32206e841376f8fdd41ffd3d3fdab4c0107c453b5c3d867b",
"md5": "e11ac081a84a908b859b0d9877020eed",
"sha256": "a12557eab48cca465615b48384a297e280d17866087be2dafde54fc3c6fc4539"
},
"downloads": -1,
"filename": "fly_log-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "e11ac081a84a908b859b0d9877020eed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3743,
"upload_time": "2023-12-06T06:04:59",
"upload_time_iso_8601": "2023-12-06T06:04:59.842109Z",
"url": "https://files.pythonhosted.org/packages/58/78/7a454eff83af32206e841376f8fdd41ffd3d3fdab4c0107c453b5c3d867b/fly_log-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-06 06:04:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zero-space-man-community",
"github_project": "fly_log",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fly-log"
}