| Name | nyanger JSON |
| Version |
0.9.1
JSON |
| download |
| home_page | None |
| Summary | Simple logger. Simple to use. Simple to modify. |
| upload_time | 2024-08-05 21:20:16 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Nyanger - simple logger
**Nyanger** is a simple logger designed to be simple to use and simple to modify.
Creation of Nyanger was motivated by the need of a simple logging facility for simple everyday scripts as well as simple logging solution for complex multiprocessing code.
Nyanger designed to be simultaneously: working solution, prototype, and code example.
So use Nyanger as is, extend it with **LogWriters**, or modify source code to fill your needs.
Nyanger consist of 3 modules:
- **async** (for the use with asyncio)
- **process** (for use with code of any complexity, but especially complex multiprocessing/multithreading code)
- **simple** (for plain simple scripts or multithreading code)
# Compatibility
Nyanger compatible with **Linux** (and probably any *NIX), and probably with **Windows** (feel free to test and report any issues)
# Usage
All 3 modules follow same pattern:
1. `Nyanger` is our logger class. You need to get instance of it ether by creating object manually or by calling `get_logger` method.
2. You must provide list of `LogWriter` objects to `Nyanger` constructor, if `get_logger` called without this list then default console `LogWriter` will be created.
3. You can create your own log writes by implementing `LogWriter` abstract class.
4. You start logger by calling `start()` method.
5. You use it by calling `other()` `info()` `warning()` `error()` `debug()` or `log()` methods of `Nyanger` instance.
6. Before ending your program you're stopping logger by calling `stop()` method.
# Example
Init Nyanger directly:
```python
import nyanger.process as nya
import nyanger.process.log_writers.console_writer as cwr
log: nya.Nyanger
if __name__ == '__main__':
# Init logger
log = nya.Nyanger("pur", loging_level=nya.LogLevel.DEBUG, log_writers=[cwr.ConsoleWriter()])
log.start()
log.other("Other test pur")
log.info("Info test put")
log.warning("Warning test pur")
log.error("Error test pur")
log.debug("Debug test pur")
log.stop()
```
Using get_logger helper:
```python
import nyanger.process.static as nya_stat
# Init logger
log = nya_stat.get_logger("nyan")
if __name__ == '__main__':
log.start()
log.other("Other test pur")
log.info("Info test put")
log.warning("Warning test pur")
log.error("Error test pur")
log.debug("Debug test pur")
log.stop()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "nyanger",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Kirill Harmatulla Shakirov <kirill.shakirov@protonmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fd/5c/e3dc8dd9748db5765bbebd1562c11715fd248ec7d455836e286ecb54164b/nyanger-0.9.1.tar.gz",
"platform": null,
"description": "# Nyanger - simple logger\n\n**Nyanger** is a simple logger designed to be simple to use and simple to modify.\n\nCreation of Nyanger was motivated by the need of a simple logging facility for simple everyday scripts as well as simple logging solution for complex multiprocessing code.\n\nNyanger designed to be simultaneously: working solution, prototype, and code example.\nSo use Nyanger as is, extend it with **LogWriters**, or modify source code to fill your needs.\n\nNyanger consist of 3 modules:\n- **async** (for the use with asyncio)\n- **process** (for use with code of any complexity, but especially complex multiprocessing/multithreading code)\n- **simple** (for plain simple scripts or multithreading code)\n\n# Compatibility\nNyanger compatible with **Linux** (and probably any *NIX), and probably with **Windows** (feel free to test and report any issues)\n\n# Usage\nAll 3 modules follow same pattern:\n1. `Nyanger` is our logger class. You need to get instance of it ether by creating object manually or by calling `get_logger` method. \n2. You must provide list of `LogWriter` objects to `Nyanger` constructor, if `get_logger` called without this list then default console `LogWriter` will be created.\n3. You can create your own log writes by implementing `LogWriter` abstract class.\n4. You start logger by calling `start()` method.\n5. You use it by calling `other()` `info()` `warning()` `error()` `debug()` or `log()` methods of `Nyanger` instance.\n6. Before ending your program you're stopping logger by calling `stop()` method.\n\n# Example\nInit Nyanger directly:\n\n```python\nimport nyanger.process as nya\nimport nyanger.process.log_writers.console_writer as cwr\n\nlog: nya.Nyanger\n\nif __name__ == '__main__':\n # Init logger\n log = nya.Nyanger(\"pur\", loging_level=nya.LogLevel.DEBUG, log_writers=[cwr.ConsoleWriter()])\n\n log.start()\n log.other(\"Other test pur\")\n log.info(\"Info test put\")\n log.warning(\"Warning test pur\")\n log.error(\"Error test pur\")\n log.debug(\"Debug test pur\")\n log.stop()\n```\n\nUsing get_logger helper:\n```python\nimport nyanger.process.static as nya_stat\n\n# Init logger\nlog = nya_stat.get_logger(\"nyan\")\n\nif __name__ == '__main__':\n log.start()\n log.other(\"Other test pur\")\n log.info(\"Info test put\")\n log.warning(\"Warning test pur\")\n log.error(\"Error test pur\")\n log.debug(\"Debug test pur\")\n log.stop()\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Simple logger. Simple to use. Simple to modify.",
"version": "0.9.1",
"project_urls": {
"Homepage": "https://github.com/Nyanraltotlapun/Nyanger",
"Issues": "https://github.com/Nyanraltotlapun/Nyanger/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "10ce8a352b26702acfc97e073eb5357478e45c73eb933b3f8af19a96d38df9d0",
"md5": "5dca919b18a5cf6543d2c8306888a7b8",
"sha256": "0348dab55a721fd96bb71b77f4e4cd60c3027486196b526fc7da4ca00951fa08"
},
"downloads": -1,
"filename": "nyanger-0.9.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5dca919b18a5cf6543d2c8306888a7b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 33269,
"upload_time": "2024-08-05T21:20:14",
"upload_time_iso_8601": "2024-08-05T21:20:14.554625Z",
"url": "https://files.pythonhosted.org/packages/10/ce/8a352b26702acfc97e073eb5357478e45c73eb933b3f8af19a96d38df9d0/nyanger-0.9.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd5ce3dc8dd9748db5765bbebd1562c11715fd248ec7d455836e286ecb54164b",
"md5": "1dc067adfcb4e38c3347e2491a8d0264",
"sha256": "4d94292215dc2a38282cfcb356b54c9c463749c923344288ad347ed64e506394"
},
"downloads": -1,
"filename": "nyanger-0.9.1.tar.gz",
"has_sig": false,
"md5_digest": "1dc067adfcb4e38c3347e2491a8d0264",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 20176,
"upload_time": "2024-08-05T21:20:16",
"upload_time_iso_8601": "2024-08-05T21:20:16.010965Z",
"url": "https://files.pythonhosted.org/packages/fd/5c/e3dc8dd9748db5765bbebd1562c11715fd248ec7d455836e286ecb54164b/nyanger-0.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-05 21:20:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Nyanraltotlapun",
"github_project": "Nyanger",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nyanger"
}