# log_wizard
## Installation
To get started with Log Wizard, you can easily install it using pip
```bash
pip install log-wizard
```
## usage
```python
from log_wizard import DefaultConfig, log
# initilize DefaultConfig if need
# You can do it onece, before first call of log
# Also look at params for DefaultConfig
# info_file_postfix takes all log msgs except .debug
# debug_file_postfixh takes all log msgs
DefaultConfig(info_file_postfix = 'info', debug_file_postfixh = 'debug')
# I can add a handler for your own function
# DefaultConfig().set_ui_log_func(print)
# now in any module of your project you can use this log
log = log()
# write log info
log.info("info") # 20.09.2023 06:10:35 - INFO - info
log.error("error") # 20.09.2023 06:10:35 - ERROR - error
log,critical("critical") # 20.09.2023 06:10:35 - CTITICAL - critical
proc_id = '12345'
with log.insert_proc_id(proc_id):
#20.09.2023 06:10:35 - INFO - 12345 - here should be proc id
log.info("here should be proc id")
with log.insert_func_name():
log.info("here also should be proc id and a func name, where log was called")
```
## Configuration
You can configure Log Wizard by modifying the DefaultConfig class.
## Features
Insert process IDs into log messages
Insert function names into log messages
Supports different log levels (info, error, debug, critical, etc.)
## License
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
## Contact
For any questions or feedback, feel free to contact me at ruslan.izhakovskij@gmail.com.
Raw data
{
"_id": null,
"home_page": "https://github.com/izharus/log_wizard",
"name": "log-wizard",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "python logging",
"author": "izharus",
"author_email": "ruslan.izhakovskij@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/22/5b/be858d52e85b2d40bc612d05876179e6709f7f2fd932a07eeb27c987f96d/log_wizard-1.2.0.tar.gz",
"platform": null,
"description": "# log_wizard\r\n\r\n## Installation\r\nTo get started with Log Wizard, you can easily install it using pip\r\n```bash\r\npip install log-wizard\r\n```\r\n\r\n## usage\r\n```python\r\nfrom log_wizard import DefaultConfig, log\r\n# initilize DefaultConfig if need\r\n# You can do it onece, before first call of log\r\n# Also look at params for DefaultConfig\r\n# info_file_postfix takes all log msgs except .debug\r\n# debug_file_postfixh takes all log msgs\r\n\r\nDefaultConfig(info_file_postfix = 'info', debug_file_postfixh = 'debug')\r\n# I can add a handler for your own function\r\n# DefaultConfig().set_ui_log_func(print)\r\n\r\n\r\n# now in any module of your project you can use this log\r\nlog = log()\r\n\r\n# write log info\r\nlog.info(\"info\") # 20.09.2023 06:10:35 - INFO - info\r\nlog.error(\"error\") # 20.09.2023 06:10:35 - ERROR - error\r\nlog,critical(\"critical\") # 20.09.2023 06:10:35 - CTITICAL - critical\r\nproc_id = '12345'\r\nwith log.insert_proc_id(proc_id):\r\n #20.09.2023 06:10:35 - INFO - 12345 - here should be proc id\r\n log.info(\"here should be proc id\")\r\n with log.insert_func_name():\r\n log.info(\"here also should be proc id and a func name, where log was called\")\r\n```\r\n\r\n## Configuration\r\nYou can configure Log Wizard by modifying the DefaultConfig class.\r\n\r\n## Features\r\nInsert process IDs into log messages\r\nInsert function names into log messages\r\nSupports different log levels (info, error, debug, critical, etc.)\r\n\r\n## License\r\nThis project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.\r\n\r\n## Contact\r\nFor any questions or feedback, feel free to contact me at ruslan.izhakovskij@gmail.com.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Siple logging for porject with multiple modules",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/izharus/log_wizard"
},
"split_keywords": [
"python",
"logging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e7401317fcba13efbb55561c001f883db099a6a68b4c3891f511e278884b01e",
"md5": "5f9c03f2464c30ce51dd488cf20feff3",
"sha256": "4f21e95f2d40404768fca98c17ed5e5d7b6eac1174fe2bcf5c7110db00d11f80"
},
"downloads": -1,
"filename": "log_wizard-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5f9c03f2464c30ce51dd488cf20feff3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 11682,
"upload_time": "2023-10-11T18:08:33",
"upload_time_iso_8601": "2023-10-11T18:08:33.801980Z",
"url": "https://files.pythonhosted.org/packages/9e/74/01317fcba13efbb55561c001f883db099a6a68b4c3891f511e278884b01e/log_wizard-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "225bbe858d52e85b2d40bc612d05876179e6709f7f2fd932a07eeb27c987f96d",
"md5": "3db8fcfa31f4ad523bbb0e2ec377255a",
"sha256": "3c30d01161cc004f6d9be38fb653b38bf97d519c4e5c3ca13fdc2edc98fe6696"
},
"downloads": -1,
"filename": "log_wizard-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "3db8fcfa31f4ad523bbb0e2ec377255a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 10718,
"upload_time": "2023-10-11T18:08:35",
"upload_time_iso_8601": "2023-10-11T18:08:35.128229Z",
"url": "https://files.pythonhosted.org/packages/22/5b/be858d52e85b2d40bc612d05876179e6709f7f2fd932a07eeb27c987f96d/log_wizard-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-11 18:08:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "izharus",
"github_project": "log_wizard",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "log-wizard"
}