Name | process-logging JSON |
Version |
0.2.0
JSON |
| download |
home_page | |
Summary | Simple logging module run on process with python logging |
upload_time | 2023-08-30 02:21:20 |
maintainer | |
docs_url | None |
author | kyon333 |
requires_python | >=3.10 |
license | |
keywords |
logging
multiprocess
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# how to use
## 1. define configuration and call set_logger method to start logging process in main
```
from process_logging.logger import Logger, HandlerType
logger = Logger()
log_fime_name = "{:%Y-%m-%d}_info.log".format(datetime.now())
log_path = "./logs/"
trf_handler_args = {"filename": log_path + log_fime_name,
"when": "midnight",
"interval": 1,
"encoding": "utf-8"}
format_def = ("[%(levelname)s] | %(process)d | %(asctime)s | %(message)s", "%Y-%m-%d %H:%M:%S")
handler_def = {HandlerType.StreamHandler: {}, HandlerType.TimedRotateFileHandler: trf_handler_args}
if __name__ == "__main__":
logger.set_logger(name="logger", level=logging.INFO, handler_def=handler_def, format_def=format_def)
```
## 2. atfer set _logger, you can logging anywhere in your project with Logger()
```angular2html
@cbv(project_router)
class Router:
def __init__(self):
self._logger = Logger()
@project_router.get(PREFIX)
def test_func(self):
# logging
self._logger.logging(name="logger", level=logging.INFO, message="logging test")
```
## 3. result
```angular2html
[INFO] | 4147 | 2023-08-30 10:09:29 | logging test
```
Raw data
{
"_id": null,
"home_page": "",
"name": "process-logging",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "logging,multiprocess",
"author": "kyon333",
"author_email": "originky2@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f8/19/39c18dc2b54d968cf657220464df425b4f7dd88908b8261950b3bdf233af/process_logging-0.2.0.tar.gz",
"platform": null,
"description": "# how to use\r\n## 1. define configuration and call set_logger method to start logging process in main\r\n```\r\nfrom process_logging.logger import Logger, HandlerType\r\n\r\nlogger = Logger()\r\nlog_fime_name = \"{:%Y-%m-%d}_info.log\".format(datetime.now())\r\nlog_path = \"./logs/\"\r\ntrf_handler_args = {\"filename\": log_path + log_fime_name,\r\n \"when\": \"midnight\",\r\n \"interval\": 1,\r\n \"encoding\": \"utf-8\"}\r\nformat_def = (\"[%(levelname)s] | %(process)d | %(asctime)s | %(message)s\", \"%Y-%m-%d %H:%M:%S\")\r\nhandler_def = {HandlerType.StreamHandler: {}, HandlerType.TimedRotateFileHandler: trf_handler_args}\r\n\r\nif __name__ == \"__main__\":\r\n logger.set_logger(name=\"logger\", level=logging.INFO, handler_def=handler_def, format_def=format_def)\r\n```\r\n\r\n## 2. atfer set _logger, you can logging anywhere in your project with Logger()\r\n```angular2html\r\n@cbv(project_router)\r\nclass Router:\r\n def __init__(self):\r\n self._logger = Logger()\r\n\r\n @project_router.get(PREFIX)\r\n def test_func(self):\r\n # logging\r\n self._logger.logging(name=\"logger\", level=logging.INFO, message=\"logging test\")\r\n```\r\n\r\n## 3. result\r\n```angular2html\r\n[INFO] | 4147 | 2023-08-30 10:09:29 | logging test\r\n```\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Simple logging module run on process with python logging",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [
"logging",
"multiprocess"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc1d30ed0a5cd8da5fb68e0332272b68c10aef68a432c37c87f57b4095eee5e8",
"md5": "553bed7cc14c5655741b19a3303bd176",
"sha256": "bf3b113605701f0b8c5146d36ac4155441feac81068a20654ab080ffab33b58c"
},
"downloads": -1,
"filename": "process_logging-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "553bed7cc14c5655741b19a3303bd176",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 3080,
"upload_time": "2023-08-30T02:21:19",
"upload_time_iso_8601": "2023-08-30T02:21:19.505781Z",
"url": "https://files.pythonhosted.org/packages/bc/1d/30ed0a5cd8da5fb68e0332272b68c10aef68a432c37c87f57b4095eee5e8/process_logging-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f81939c18dc2b54d968cf657220464df425b4f7dd88908b8261950b3bdf233af",
"md5": "e1b51e03476db26af77919fabe80add3",
"sha256": "769d21470fbdece9b1f58aacb81c410ce6dd68ddf98fd98a03a4de755be3a4ae"
},
"downloads": -1,
"filename": "process_logging-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "e1b51e03476db26af77919fabe80add3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 2796,
"upload_time": "2023-08-30T02:21:20",
"upload_time_iso_8601": "2023-08-30T02:21:20.635843Z",
"url": "https://files.pythonhosted.org/packages/f8/19/39c18dc2b54d968cf657220464df425b4f7dd88908b8261950b3bdf233af/process_logging-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-30 02:21:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "process-logging"
}