Name | ezloglib JSON |
Version |
1.0.1
JSON |
| download |
home_page | |
Summary | Small modern colored logging library |
upload_time | 2023-05-03 17:27:43 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2023 ftdot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
easy
colored
color
library
logging
logs
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<img src="https://github.com/ftdot/ezlog/blob/master/docs/source/present.png" />
</p>
# ezlog
[![Documentation](https://img.shields.io/readthedocs/ezlog?style=for-the-badge)](https://ezlog.readthedocs.io/)
[![Issues](https://img.shields.io/github/issues/ftdot/ezlog?style=for-the-badge)](https://github.com/ftdot/ezlog/issues)
[![Latest tag](https://img.shields.io/github/v/tag/ftdot/ezlog?style=for-the-badge)](https://github.com/ftdot/ezlog/tags)
[![PyPI](https://img.shields.io/pypi/v/ezloglib?style=for-the-badge)](https://pypi.org/project/ezloglib)
Modern, simple in use, fast, colored logging library for python.
* Formatting support
* Stdout\\Stderr\\File handlers
* Easy to use & add custom handlers
* Colored and customizable
## Installation
You can install this via **pip** (Windows):
```sh
pip install ezloglib
```
And also for linux systems:
```sh
pip3 install ezloglib
```
Read more about this on the [documentation](https://ezlog.readthedocs.io/)
## Examples
Example from the [documentation](https://ezlog.readthedocs.io/).
File: [examples/presentation.py](examples/presentation.py)
```py
import ezlog
import math
# declare stdout handler with log level - debug
sout_handler = ezlog.StdoutHandler(log_level='debug')
# initialize main logger
main_logger = ezlog.Logger('Main', handlers=[sout_handler])
# examples of the default log levels
main_logger.debug('This is {} message', 'debug')
main_logger.exception('This is {} message', 'exception')
main_logger.info('This is {} message', 'info')
main_logger.warning('This is {} message', 'warning')
main_logger.error('This is {} message', 'error')
main_logger.critical('This is critical message')
# pretty formatting + colored types
main_logger.debug('Int: {} List: {} Dict: {}', 13, [1, 2, 3], {'hello': 'world'})
main_logger.exception('Tuple: {} Bool: {} Bytes: {}', ('hello', 'world'), True, b'whois?')
main_logger.info('Float: {}', math.pi)
main_logger.warning('Exception (color): {}', NameError("name 'abc' is not defined"))
# example of the formatting
main_logger.info('{:<20}--{:>19}', 'pi is', f'{math.pi:.2f}')
# example exception logging
try:
printt('Hello, world!')
except Exception as e:
# NOTE: You can use also debug, critical and other log levels to print exception
main_logger.exception('Exception example', exception=e)
main_logger.info('It is continue work')
```
File: [examples/groups_filelogging.py](examples/groups_filelogging.py)
```py
import ezlog
# declare stdout handler with log level - debug
file_handler = ezlog.FileHandler('example.log', log_level='debug')
sout_handler = ezlog.StdoutHandler(log_level='info') # recommended: exception log level as default
# initialize example groups
example_group = ezlog.LoggerGroup('Example', handlers=[sout_handler, file_handler])
groups_group = ezlog.LoggerGroup('Groups', parent=example_group)
main_logger = ezlog.Logger('Main', group=groups_group)
# examples of the default log levels
main_logger.debug('This is {} message', 'debug')
main_logger.exception('This is {} message', 'exception')
main_logger.info('This is {} message', 'info')
main_logger.warning('This is {} message', 'warning')
main_logger.error('This is {} message', 'error')
main_logger.critical('This is critical message')
```
Raw data
{
"_id": null,
"home_page": "",
"name": "ezloglib",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "easy,colored,color,library,logging,logs",
"author": "",
"author_email": "ftdot <ftdoot@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/0d/2c/4b51a550b825718d4926ca69856ed778bc04aaa11931dae62b9a55948899/ezloglib-1.0.1.tar.gz",
"platform": null,
"description": "\r\n<p align=\"center\">\r\n <img src=\"https://github.com/ftdot/ezlog/blob/master/docs/source/present.png\" />\r\n</p>\r\n\r\n# ezlog\r\n\r\n[![Documentation](https://img.shields.io/readthedocs/ezlog?style=for-the-badge)](https://ezlog.readthedocs.io/)\r\n[![Issues](https://img.shields.io/github/issues/ftdot/ezlog?style=for-the-badge)](https://github.com/ftdot/ezlog/issues)\r\n[![Latest tag](https://img.shields.io/github/v/tag/ftdot/ezlog?style=for-the-badge)](https://github.com/ftdot/ezlog/tags)\r\n[![PyPI](https://img.shields.io/pypi/v/ezloglib?style=for-the-badge)](https://pypi.org/project/ezloglib)\r\n \r\nModern, simple in use, fast, colored logging library for python.\r\n\r\n* Formatting support\r\n* Stdout\\\\Stderr\\\\File handlers\r\n* Easy to use & add custom handlers\r\n* Colored and customizable\r\n\r\n\r\n## Installation\r\n\r\nYou can install this via **pip** (Windows):\r\n\r\n```sh\r\npip install ezloglib\r\n```\r\n\r\nAnd also for linux systems:\r\n\r\n```sh\r\npip3 install ezloglib\r\n```\r\n\r\nRead more about this on the [documentation](https://ezlog.readthedocs.io/)\r\n\r\n\r\n## Examples\r\n\r\nExample from the [documentation](https://ezlog.readthedocs.io/).\r\n\r\nFile: [examples/presentation.py](examples/presentation.py)\r\n\r\n```py\r\n\r\nimport ezlog\r\nimport math\r\n\r\n# declare stdout handler with log level - debug\r\nsout_handler = ezlog.StdoutHandler(log_level='debug')\r\n\r\n# initialize main logger\r\nmain_logger = ezlog.Logger('Main', handlers=[sout_handler])\r\n\r\n# examples of the default log levels\r\nmain_logger.debug('This is {} message', 'debug')\r\nmain_logger.exception('This is {} message', 'exception')\r\nmain_logger.info('This is {} message', 'info')\r\nmain_logger.warning('This is {} message', 'warning')\r\nmain_logger.error('This is {} message', 'error')\r\nmain_logger.critical('This is critical message')\r\n\r\n# pretty formatting + colored types\r\nmain_logger.debug('Int: {} List: {} Dict: {}', 13, [1, 2, 3], {'hello': 'world'})\r\nmain_logger.exception('Tuple: {} Bool: {} Bytes: {}', ('hello', 'world'), True, b'whois?')\r\nmain_logger.info('Float: {}', math.pi)\r\nmain_logger.warning('Exception (color): {}', NameError(\"name 'abc' is not defined\"))\r\n\r\n# example of the formatting\r\nmain_logger.info('{:<20}--{:>19}', 'pi is', f'{math.pi:.2f}')\r\n\r\n# example exception logging\r\ntry:\r\n printt('Hello, world!')\r\nexcept Exception as e:\r\n # NOTE: You can use also debug, critical and other log levels to print exception\r\n main_logger.exception('Exception example', exception=e)\r\n\r\nmain_logger.info('It is continue work')\r\n```\r\n\r\nFile: [examples/groups_filelogging.py](examples/groups_filelogging.py)\r\n\r\n```py\r\n\r\nimport ezlog\r\n\r\n# declare stdout handler with log level - debug\r\nfile_handler = ezlog.FileHandler('example.log', log_level='debug')\r\nsout_handler = ezlog.StdoutHandler(log_level='info') # recommended: exception log level as default\r\n\r\n# initialize example groups\r\nexample_group = ezlog.LoggerGroup('Example', handlers=[sout_handler, file_handler])\r\ngroups_group = ezlog.LoggerGroup('Groups', parent=example_group)\r\n\r\nmain_logger = ezlog.Logger('Main', group=groups_group)\r\n\r\n# examples of the default log levels\r\nmain_logger.debug('This is {} message', 'debug')\r\nmain_logger.exception('This is {} message', 'exception')\r\nmain_logger.info('This is {} message', 'info')\r\nmain_logger.warning('This is {} message', 'warning')\r\nmain_logger.error('This is {} message', 'error')\r\nmain_logger.critical('This is critical message')\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 ftdot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Small modern colored logging library",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://ezlog.readthedocs.io/",
"Homepage": "https://github.com/ftdot/ezlog"
},
"split_keywords": [
"easy",
"colored",
"color",
"library",
"logging",
"logs"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33b861875e2b4ddd44a36c7ddaf5eb29aceb39d029d82ad692923cccdb17425e",
"md5": "5d47c155b01325bd68d5d5626fe9e7fa",
"sha256": "bc380f10a99dbf19d7f5368724243fdb3486de45e1c21eeb86abbf5bb588fdcb"
},
"downloads": -1,
"filename": "ezloglib-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5d47c155b01325bd68d5d5626fe9e7fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 11009,
"upload_time": "2023-05-03T17:27:38",
"upload_time_iso_8601": "2023-05-03T17:27:38.558171Z",
"url": "https://files.pythonhosted.org/packages/33/b8/61875e2b4ddd44a36c7ddaf5eb29aceb39d029d82ad692923cccdb17425e/ezloglib-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0d2c4b51a550b825718d4926ca69856ed778bc04aaa11931dae62b9a55948899",
"md5": "d27576fd35f60554dc3b1ab54ddb45dd",
"sha256": "e571399db50d61a83588802c8911cc2d0e8545fb4f37d5a9d6f5286bf2e6c9d6"
},
"downloads": -1,
"filename": "ezloglib-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "d27576fd35f60554dc3b1ab54ddb45dd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 10425,
"upload_time": "2023-05-03T17:27:43",
"upload_time_iso_8601": "2023-05-03T17:27:43.120667Z",
"url": "https://files.pythonhosted.org/packages/0d/2c/4b51a550b825718d4926ca69856ed778bc04aaa11931dae62b9a55948899/ezloglib-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-03 17:27:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ftdot",
"github_project": "ezlog",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "ezloglib"
}