fly_log
========
最简单的日志,比 print 函数,多了时间与源文件信息。用于比较小的python项目,是适合的。
`from fly_log import debug_print as print, log_time `
特点
========
功能简单,小的程序非常适用
与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)
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/61/e9/0cc86d013ef7835182b39494053cf337d2c1ac3ba8c4227ca02fb5e961ef/fly_log-0.2.2.tar.gz",
"platform": "any",
"description": "fly_log\n========\n\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\n\n`from fly_log import debug_print as print, log_time `\n\n\u7279\u70b9\n========\n \u529f\u80fd\u7b80\u5355\uff0c\u5c0f\u7684\u7a0b\u5e8f\u975e\u5e38\u9002\u7528\n \u4e0eprint\u51fd\u6570\u4e00\u81f4\uff0c\u5982\u679c\u5f71\u54cd\u6548\u7387\uff0c\u6ce8\u91ca\u6389\u76f8\u5e94\u7684\u4ee3\u7801\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\n\n\u5b89\u88c5\u8bf4\u660e\n=======\n\n\u4ee3\u7801\u5bf9 Python 3 \u517c\u5bb9\n\n* \u5168\u81ea\u52a8\u5b89\u88c5\uff1a`pip install fly-log` / `pip3 install fly-log`\n\n\u4ee3\u7801\u793a\u4f8b\n \n```python\nfrom fly_log import debug_print as print\nimport time \n\ndef test1():\n print(\"my fly log \") \n\n@log_time \ndef test2():\n time.sleep(0.5) \n\ntest1()\ntest2()\n\n# \u8f93\u51fa\u8fd9\u6837\u7684\u683c\u5f0f\n# 2023-03-26 19:50:04.338 test1(fly_log_sample_dev_run.py:6) my fly log \n# 2023-03-26 19:50:04.843 test2() (fly_log_sample_dev_run.py:15) time cost 0.504 sec \n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "a simple log for small project",
"version": "0.2.2",
"split_keywords": [
"fly",
"log",
"debug"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5cd86106ee49872c4b4f63026189d6c58a99077d7bb49c36b474d7576f1e9401",
"md5": "df1429ec8c9b11c52f007bb5ca3d6948",
"sha256": "2a4f61c2d60c3ef39b1fb9700574c1c24fbda44ee148d28099e56f237045c295"
},
"downloads": -1,
"filename": "fly_log-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "df1429ec8c9b11c52f007bb5ca3d6948",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3852,
"upload_time": "2023-03-26T12:06:26",
"upload_time_iso_8601": "2023-03-26T12:06:26.736359Z",
"url": "https://files.pythonhosted.org/packages/5c/d8/6106ee49872c4b4f63026189d6c58a99077d7bb49c36b474d7576f1e9401/fly_log-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "61e90cc86d013ef7835182b39494053cf337d2c1ac3ba8c4227ca02fb5e961ef",
"md5": "5fef3a958bcb6c6bc8df5473a086a377",
"sha256": "5f05bd993fd3ab05dda79ef36c9135924a9129f64567026ddd91f4e6066241ba"
},
"downloads": -1,
"filename": "fly_log-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "5fef3a958bcb6c6bc8df5473a086a377",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3421,
"upload_time": "2023-03-26T12:06:29",
"upload_time_iso_8601": "2023-03-26T12:06:29.822571Z",
"url": "https://files.pythonhosted.org/packages/61/e9/0cc86d013ef7835182b39494053cf337d2c1ac3ba8c4227ca02fb5e961ef/fly_log-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-26 12:06:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "zero-space-man-community",
"github_project": "fly_log",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fly-log"
}