Name | ykenan-log JSON |
Version |
0.2.1
JSON |
| download |
home_page | None |
Summary | Log information: Print the log, export the log file. |
upload_time | 2024-04-13 04:53:24 |
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 = True,
>
>> 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 True.
: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/0b/9e/5e2aea06ef9fcb660fad726f9080973e27449b6b355a74bd38cd73a133c7/ykenan_log-0.2.1.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 = True,\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 True.\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.1",
"project_urls": {
"github": "https://github.com/YuZhengM/ykenan_log"
},
"split_keywords": [
"ykenan",
" log",
" file"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4fed33f10b5b3597a969843034acb1a6eb81da0d8502a781786108392414ab8b",
"md5": "24c612e642b1d418bb48e3bb076edc3a",
"sha256": "aeb3bbbc3a1716fd0f6ed440ca1b3b644f52964e2d5915273e275c452900cbef"
},
"downloads": -1,
"filename": "ykenan_log-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "24c612e642b1d418bb48e3bb076edc3a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5088,
"upload_time": "2024-04-13T04:53:23",
"upload_time_iso_8601": "2024-04-13T04:53:23.150817Z",
"url": "https://files.pythonhosted.org/packages/4f/ed/33f10b5b3597a969843034acb1a6eb81da0d8502a781786108392414ab8b/ykenan_log-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0b9e5e2aea06ef9fcb660fad726f9080973e27449b6b355a74bd38cd73a133c7",
"md5": "c907451752bca82dc1b8ceede40d7f32",
"sha256": "e46705c9cfb4509f510273c67ce45a38c1cd4a6b42dc0eb7c8e3b2372a9d0b50"
},
"downloads": -1,
"filename": "ykenan_log-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "c907451752bca82dc1b8ceede40d7f32",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4727,
"upload_time": "2024-04-13T04:53:24",
"upload_time_iso_8601": "2024-04-13T04:53:24.769482Z",
"url": "https://files.pythonhosted.org/packages/0b/9e/5e2aea06ef9fcb660fad726f9080973e27449b6b355a74bd38cd73a133c7/ykenan_log-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-13 04:53:24",
"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"
}