Name | ykenan-log JSON |
Version |
0.2.3
JSON |
| download |
home_page | None |
Summary | Log information: Print the log, export the log file. |
upload_time | 2024-11-19 08:11:02 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | None |
keywords |
ykenan
log
file
|
VCS |
|
bugtrack_url |
|
requirements |
coloredlogs
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ykenan_log
> **`Print and save a simple log to a file`**
This is a simple log package. You can see
[Github-ykenan_log](https://github.com/YuZhengM/ykenan_log)
[PyPI-ykenan_log](https://pypi.org/project/ykenan-log/)
> upload
```shell
py -m build
twine check dist/*
twine upload dist/*
```
## Use
> install
```shell
pip install ykenan_log
```
> use
```python
# -*- coding: utf-8 -*-
from ykenan_log import Logger
log = Logger("name", "log")
if __name__ == '__main__':
print("run...")
log.debug("info......")
log.info("info......")
log.warn("info......")
log.error("info......")
```
> output
```shell
2023-03-17 09:21:36 root name[34768] DEBUG info......
2023-03-17 09:21:36 root name[34768] INFO info......
2023-03-17 09:21:36 root name[34768] WARNING info......
2023-03-17 09:21:36 root name[34768] ERROR info......
```
## Introduction
> **main function**
> ykenan_log.`Logger`(
>> name: str = None,
>
>> log_path: str = None,
>
>> level: str = "INFO",
>
>> is_solitary: bool = True,
>
>> is_form_file: bool = False,
>
>> size: int = 104857600,
>
>> backup_count: int = 10,
>
>> encoding: str = "UTF-8"
>
> )
```
:param name: Project Name
:param log_path: Log file output path. Default is log_%Y%m%d.log.
:param level: Log printing level. Default is INFO.
:param is_solitary: When the file path is consistent (here, the log_path parameter is not a specific file name, but a file path), whether the file is formed independently according to the name parameter. Default is True.
:param is_form_file: Whether to form a log file. Default is False.
:param size: Setting the file size if a file is formed. Default is 104857600. (100MB)
:param backup_count: Setting the number of rotating files if a file is formed. Default is 10.
:param encoding: Setting of file encoding if a file is formed. Default is UTF-8.
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ykenan-log",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "YKenan, log, file",
"author": null,
"author_email": "Yu Zhengmin <3236170161@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/9b/ca/c53a36f4b95490511d07e79e605c73845b0579d9d059fd465fda0ea1e15c/ykenan_log-0.2.3.tar.gz",
"platform": null,
"description": "# ykenan_log\r\n\r\n> **`Print and save a simple log to a file`**\r\n\r\nThis is a simple log package. You can see\r\n[Github-ykenan_log](https://github.com/YuZhengM/ykenan_log)\r\n[PyPI-ykenan_log](https://pypi.org/project/ykenan-log/)\r\n\r\n> upload\r\n\r\n```shell\r\npy -m build\r\ntwine check dist/*\r\ntwine upload dist/*\r\n```\r\n\r\n## Use\r\n\r\n> install\r\n\r\n```shell\r\npip install ykenan_log\r\n```\r\n\r\n> use\r\n\r\n```python\r\n# -*- coding: utf-8 -*-\r\n\r\nfrom ykenan_log import Logger\r\n\r\nlog = Logger(\"name\", \"log\")\r\n\r\nif __name__ == '__main__':\r\n print(\"run...\")\r\n log.debug(\"info......\")\r\n log.info(\"info......\")\r\n log.warn(\"info......\")\r\n log.error(\"info......\")\r\n```\r\n\r\n> output\r\n\r\n```shell\r\n2023-03-17 09:21:36 root name[34768] DEBUG info......\r\n2023-03-17 09:21:36 root name[34768] INFO info......\r\n2023-03-17 09:21:36 root name[34768] WARNING info......\r\n2023-03-17 09:21:36 root name[34768] ERROR info......\r\n\r\n```\r\n\r\n## Introduction\r\n\r\n> **main function**\r\n\r\n> ykenan_log.`Logger`(\r\n>> name: str = None,\r\n>\r\n>> log_path: str = None,\r\n>\r\n>> level: str = \"INFO\",\r\n>\r\n>> is_solitary: bool = True,\r\n>\r\n>> is_form_file: bool = False,\r\n>\r\n>> size: int = 104857600,\r\n>\r\n>> backup_count: int = 10,\r\n>\r\n>> encoding: str = \"UTF-8\"\r\n>\r\n> )\r\n\r\n```\r\n:param name: Project Name\r\n:param log_path: Log file output path. Default is log_%Y%m%d.log.\r\n:param level: Log printing level. Default is INFO.\r\n:param is_solitary: When the file path is consistent (here, the log_path parameter is not a specific file name, but a file path), whether the file is formed independently according to the name parameter. Default is True.\r\n:param is_form_file: Whether to form a log file. Default is False.\r\n:param size: Setting the file size if a file is formed. Default is 104857600. (100MB)\r\n:param backup_count: Setting the number of rotating files if a file is formed. Default is 10.\r\n:param encoding: Setting of file encoding if a file is formed. Default is UTF-8.\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Log information: Print the log, export the log file.",
"version": "0.2.3",
"project_urls": {
"github": "https://github.com/YuZhengM/ykenan_log"
},
"split_keywords": [
"ykenan",
" log",
" file"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b4d576fb8a0f1062e9109515733a4cf692dc773ef7aa66239f4937ef87ea383b",
"md5": "40dc59501064ad45b7b1057db681cfcb",
"sha256": "d9ea0afb3aab9449fad55f2ec57ba97d0f5125c592c6a8d138f0e7a19cdc00ba"
},
"downloads": -1,
"filename": "ykenan_log-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "40dc59501064ad45b7b1057db681cfcb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5134,
"upload_time": "2024-11-19T08:10:59",
"upload_time_iso_8601": "2024-11-19T08:10:59.748960Z",
"url": "https://files.pythonhosted.org/packages/b4/d5/76fb8a0f1062e9109515733a4cf692dc773ef7aa66239f4937ef87ea383b/ykenan_log-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9bcac53a36f4b95490511d07e79e605c73845b0579d9d059fd465fda0ea1e15c",
"md5": "fdd4585c1f5e819b76d369f43f0185d6",
"sha256": "a97f5e1ecdff7f7bae443ccdfa4fe903806a4d8cd306dedc013117a831a291dc"
},
"downloads": -1,
"filename": "ykenan_log-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "fdd4585c1f5e819b76d369f43f0185d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4756,
"upload_time": "2024-11-19T08:11:02",
"upload_time_iso_8601": "2024-11-19T08:11:02.599597Z",
"url": "https://files.pythonhosted.org/packages/9b/ca/c53a36f4b95490511d07e79e605c73845b0579d9d059fd465fda0ea1e15c/ykenan_log-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 08:11:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "YuZhengM",
"github_project": "ykenan_log",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "coloredlogs",
"specs": [
[
">=",
"15.0"
]
]
}
],
"lcname": "ykenan-log"
}