python-just-logger


Namepython-just-logger JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/duvrdx/just_logger
Summary
upload_time2024-03-04 14:53:21
maintainer
docs_urlNone
authorEduardo
requires_python>=3.10
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            \n

# Just Logger 
__________________________________________

This is a library featuring a simple logger for Python 3.


## Features
_________________________________________
- Add Log by Type ✔️
- Save Log's to file ✔️
- Filter Log's by Type ✔️
- Configure by .env ✔️

## Using 
__________________________________________

Here's how you can use this library to log events. First, let's understand the options for Levels and Filters.

### Levels
```python
class LogLevel(Enum):
  INFO = "INFO"
  WARNING = "WARNING"
  ERROR = "ERROR"
  CRITICAL = "CRITICAL"
```

### Filters
```python
class LogFilter(Enum):
  ONLY_INFO = [LogLevel.INFO]
  ONLY_WARNING = [LogLevel.WARNING]
  ONLY_ERROR = [LogLevel.ERROR]
  ONLY_CRITICAL = [LogLevel.CRITICAL]
  DEBUG = [LogLevel.INFO, LogLevel.WARNING, LogLevel.ERROR, LogLevel.CRITICAL]
  PROD = [LogLevel.WARNING, LogLevel.ERROR]
```

### Creating a Log

To create a log, first you must instantiate a Logger class. Then, create logs at the key points in your code.

```python
from just_logger import logging as jl

logger = jl.Logger(log_file="logs/log.log")

logger.info("This is an info message")
# | 2024-02-26T08:43:06.094567 - INFO: This is an info message |                                                                                        

```
This example demonstrates how to use the library to log an informational message.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/duvrdx/just_logger",
    "name": "python-just-logger",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "Eduardo",
    "author_email": "duvrdx@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b1/a7/2cb5c5c957e14600c2e7aae541dd447ecec2fa578311110e3a2cb5181417/python-just-logger-1.1.1.tar.gz",
    "platform": null,
    "description": "\\n\n\n# Just Logger \n__________________________________________\n\nThis is a library featuring a simple logger for Python 3.\n\n\n## Features\n_________________________________________\n- Add Log by Type \u2714\ufe0f\n- Save Log's to file \u2714\ufe0f\n- Filter Log's by Type \u2714\ufe0f\n- Configure by .env \u2714\ufe0f\n\n## Using \n__________________________________________\n\nHere's how you can use this library to log events. First, let's understand the options for Levels and Filters.\n\n### Levels\n```python\nclass LogLevel(Enum):\n  INFO = \"INFO\"\n  WARNING = \"WARNING\"\n  ERROR = \"ERROR\"\n  CRITICAL = \"CRITICAL\"\n```\n\n### Filters\n```python\nclass LogFilter(Enum):\n  ONLY_INFO = [LogLevel.INFO]\n  ONLY_WARNING = [LogLevel.WARNING]\n  ONLY_ERROR = [LogLevel.ERROR]\n  ONLY_CRITICAL = [LogLevel.CRITICAL]\n  DEBUG = [LogLevel.INFO, LogLevel.WARNING, LogLevel.ERROR, LogLevel.CRITICAL]\n  PROD = [LogLevel.WARNING, LogLevel.ERROR]\n```\n\n### Creating a Log\n\nTo create a log, first you must instantiate a Logger class. Then, create logs at the key points in your code.\n\n```python\nfrom just_logger import logging as jl\n\nlogger = jl.Logger(log_file=\"logs/log.log\")\n\nlogger.info(\"This is an info message\")\n# | 2024-02-26T08:43:06.094567 - INFO: This is an info message |                                                                                        \n\n```\nThis example demonstrates how to use the library to log an informational message.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/duvrdx/just_logger"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d3c6880bc5f5e3b6e85f1c529a7ac0cb2005464dc773b0ee6375ef1d9b74c585",
                "md5": "111edd3d2902aab925995385c9acc2b5",
                "sha256": "dc2c8b4c15ce9e28044a241f1ba04f8e1892fa83b666356aedfa513da959b53c"
            },
            "downloads": -1,
            "filename": "python_just_logger-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "111edd3d2902aab925995385c9acc2b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 4138,
            "upload_time": "2024-03-04T14:53:20",
            "upload_time_iso_8601": "2024-03-04T14:53:20.374820Z",
            "url": "https://files.pythonhosted.org/packages/d3/c6/880bc5f5e3b6e85f1c529a7ac0cb2005464dc773b0ee6375ef1d9b74c585/python_just_logger-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1a72cb5c5c957e14600c2e7aae541dd447ecec2fa578311110e3a2cb5181417",
                "md5": "2035d052b9cacd41e38077c055d77460",
                "sha256": "7c884590db23192d0fa205b1692d784dfe636b84e7c33cacbb551ed5e1ee85c8"
            },
            "downloads": -1,
            "filename": "python-just-logger-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2035d052b9cacd41e38077c055d77460",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3217,
            "upload_time": "2024-03-04T14:53:21",
            "upload_time_iso_8601": "2024-03-04T14:53:21.308572Z",
            "url": "https://files.pythonhosted.org/packages/b1/a7/2cb5c5c957e14600c2e7aae541dd447ecec2fa578311110e3a2cb5181417/python-just-logger-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 14:53:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "duvrdx",
    "github_project": "just_logger",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "python-just-logger"
}
        
Elapsed time: 0.19592s