Name | EscribaLogger JSON |
Version |
2.0.3
JSON |
| download |
home_page | None |
Summary | A fast 'read to use' Logging system which provides stdout/file/custom stream with easy syntax and operation. It's a very simple approach of Laravel drivers sorts, by the way, handlers ands drivers are both the same |
upload_time | 2025-01-13 02:14:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | MIT |
keywords |
logging
logger
log
logs
drivers
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![codecov](https://codecov.io/gh/Strovsk/EscribaLogger/graph/badge.svg?token=FJFYOM8X4U)](https://codecov.io/gh/Strovsk/EscribaLogger)
<p align="center">
<img src="https://raw.githubusercontent.com/Strovsk/EscribaLogger/refs/heads/main/docs/assets/escriba%20logger%20background.png" alt="Escriba Logger Logo" width="300">
</p>
# Get Started
## install
`python -m pip install EscribaLogger`
## Usage
Just import, add drivers and use:
> You can output your logs using a pre-configured builtin [rich](https://rich.readthedocs.io/en/stable/introduction.html) stdout handler
```python
from EscribaLogger import Log
# Initilize
Log()
Log.set_logger_name('CustomName')
# Add drivers (stdout, file, graylog, flutend etc)
Log.add_driver('stdout')
Log.info('My info message', {'context_var': 'value'})
# > [01/12/25 20:30:20] INFO CustomName - My info message <stdin>:1
```
## Log file driver
```python
# You can add another driver. In this case, we will add the file driver
Log.add_driver('file')
Log.info('Some message', extra={"context_var": "value"})
# > The message will be stored in "logs/2023-07-16.log"
# > [2023-07-16 16:13:55,100] EscribaLogger.INFO - Some message - {"context_var": "value"}
```
> In the default logging system, handle context variables is a exhausting task. EscribaLogger added the "extra_context" log variable to solve this. You add the context info for any custom driver.
### Change default log files storage
```python
# You can change default path to store log files in:
Log.add_driver('file', driver_option={'file_location': 'another/path'})
Log.info('Some message', extra={"context_var": "value"})
# > The message will be stored in "another/path/2023-07-16.log"
# > [2023-07-16 16:13:55,100] EscribaLogger.INFO - Some message - {"context_var": "value"}
```
# Contributing
## Setup env
1. install pdm
```console
python -m pip install pdm
```
2. install dependencies
```console
pdm install
```
## Tests
We are using [pytest](https://docs.pytest.org/en/7.4.x/) and [coverage.py](https://coverage.readthedocs.io/en/7.2.7/) to maintain this project.
You can run the tests by using:
```console
pdm run test:unit
```
the command above will generate the `.coverage` file in root path. Now you can generate the coverage report
### Coverage
```console
coverage report -m
```
Or you can create a entire webpage to see the results:
```console
pdm run coverage html
```
Raw data
{
"_id": null,
"home_page": null,
"name": "EscribaLogger",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "logging, logger, log, logs, drivers",
"author": null,
"author_email": "Thiago Santa Clara Pereira <strovsk@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/2a/93/f50f4d8943c93f7c95d00a179e932f325b8c027312926a30e2dca58c2ae3/escribalogger-2.0.3.tar.gz",
"platform": null,
"description": "[![codecov](https://codecov.io/gh/Strovsk/EscribaLogger/graph/badge.svg?token=FJFYOM8X4U)](https://codecov.io/gh/Strovsk/EscribaLogger)\n\n<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/Strovsk/EscribaLogger/refs/heads/main/docs/assets/escriba%20logger%20background.png\" alt=\"Escriba Logger Logo\" width=\"300\">\n</p>\n\n# Get Started\n\n## install\n\n`python -m pip install EscribaLogger`\n\n## Usage\n\nJust import, add drivers and use:\n\n> You can output your logs using a pre-configured builtin [rich](https://rich.readthedocs.io/en/stable/introduction.html) stdout handler\n\n```python\nfrom EscribaLogger import Log\n\n# Initilize\nLog()\nLog.set_logger_name('CustomName')\n\n# Add drivers (stdout, file, graylog, flutend etc)\nLog.add_driver('stdout')\n\nLog.info('My info message', {'context_var': 'value'})\n# > [01/12/25 20:30:20] INFO CustomName - My info message <stdin>:1\n```\n\n## Log file driver\n\n```python\n# You can add another driver. In this case, we will add the file driver\nLog.add_driver('file')\n\n\nLog.info('Some message', extra={\"context_var\": \"value\"})\n# > The message will be stored in \"logs/2023-07-16.log\"\n# > [2023-07-16 16:13:55,100] EscribaLogger.INFO - Some message - {\"context_var\": \"value\"}\n```\n\n> In the default logging system, handle context variables is a exhausting task. EscribaLogger added the \"extra_context\" log variable to solve this. You add the context info for any custom driver.\n\n### Change default log files storage\n\n```python\n# You can change default path to store log files in:\nLog.add_driver('file', driver_option={'file_location': 'another/path'})\n\n\nLog.info('Some message', extra={\"context_var\": \"value\"})\n# > The message will be stored in \"another/path/2023-07-16.log\"\n# > [2023-07-16 16:13:55,100] EscribaLogger.INFO - Some message - {\"context_var\": \"value\"}\n```\n\n# Contributing\n\n## Setup env\n\n1. install pdm\n\n```console\npython -m pip install pdm\n```\n\n2. install dependencies\n\n```console\npdm install\n```\n\n## Tests\n\nWe are using [pytest](https://docs.pytest.org/en/7.4.x/) and [coverage.py](https://coverage.readthedocs.io/en/7.2.7/) to maintain this project.\nYou can run the tests by using:\n\n```console\npdm run test:unit\n```\n\nthe command above will generate the `.coverage` file in root path. Now you can generate the coverage report\n\n### Coverage\n\n```console\ncoverage report -m\n```\n\nOr you can create a entire webpage to see the results:\n\n```console\npdm run coverage html\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A fast 'read to use' Logging system which provides stdout/file/custom stream with easy syntax and operation. It's a very simple approach of Laravel drivers sorts, by the way, handlers ands drivers are both the same",
"version": "2.0.3",
"project_urls": {
"Github": "https://github.com/Strovsk/EscribaLogger"
},
"split_keywords": [
"logging",
" logger",
" log",
" logs",
" drivers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0874e0376b8d573b1353067aaf18360e12bf2a850a97d7c31eb34cf4fb5b8ae4",
"md5": "b04da36fecf4c2ead195d67d99ffa261",
"sha256": "35dbd882609b64cfd34c606d455fe51525da0ea23b7ca7ad308d8c0f658ec01d"
},
"downloads": -1,
"filename": "escribalogger-2.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b04da36fecf4c2ead195d67d99ffa261",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7836,
"upload_time": "2025-01-13T02:14:01",
"upload_time_iso_8601": "2025-01-13T02:14:01.124365Z",
"url": "https://files.pythonhosted.org/packages/08/74/e0376b8d573b1353067aaf18360e12bf2a850a97d7c31eb34cf4fb5b8ae4/escribalogger-2.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2a93f50f4d8943c93f7c95d00a179e932f325b8c027312926a30e2dca58c2ae3",
"md5": "65e30723305c57accad566da685d87b5",
"sha256": "3526cee19167eed4ecf27ce5bb4d20a2ad861d8cca8b65a425cc04b9b0dc3682"
},
"downloads": -1,
"filename": "escribalogger-2.0.3.tar.gz",
"has_sig": false,
"md5_digest": "65e30723305c57accad566da685d87b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7955,
"upload_time": "2025-01-13T02:14:03",
"upload_time_iso_8601": "2025-01-13T02:14:03.220648Z",
"url": "https://files.pythonhosted.org/packages/2a/93/f50f4d8943c93f7c95d00a179e932f325b8c027312926a30e2dca58c2ae3/escribalogger-2.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-13 02:14:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Strovsk",
"github_project": "EscribaLogger",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "escribalogger"
}