lognet


Namelognet JSON
Version 3.0.2 PyPI version JSON
download
home_pagehttps://github.com/Noloquideus/Lognet
SummaryA simple logger with a convenient log message format.
upload_time2024-01-11 17:32:32
maintainer
docs_urlNone
authorNoloquideus
requires_python>=3.5
licenseMIT License
keywords lognet logging logger log
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![logo](logo.png)
# Lognet
Lognet is a lightweight logging library for Python, designed to simplify the process of logging messages with different levels of severity. It provides an easy-to-use interface, customization options.

## Features
- Log Levels: Log messages with different severity levels, including DEBUG, INFO, WARNING, ERROR, and EXCEPTION.

- Convenient log message formatting

- Console and File Logging: Log messages to the console, a file, or both.

# Installation
Install Lognet Logger using pip:

```
pip install lognet
```
## ARCHITECTURE
```bash
lognet/
в”‚
в”њв”Ђв”Ђ core/
в”‚   в”њв”Ђв”Ђ __init__.py
в”‚   в”њв”Ђв”Ђ application/
в”‚   в”‚   в”њв”Ђв”Ђ __init__.py
в”‚   в”‚   в”њв”Ђв”Ђ logger.py
в”‚   в”‚   в”њв”Ђв”Ђ handlers/
в”‚   в”‚   в”‚   в”њв”Ђв”Ђ handler.py
в”‚   в”‚   в”‚   в”њв”Ђв”Ђ file_handler.py
в”‚   в”‚   в”‚   в””в”Ђв”Ђ console_handler.py
в”‚   в”‚   в”њв”Ђв”Ђ formatters/
в”‚   в”‚   в”‚   в””в”Ђв”Ђ log_formatter.py
в”‚   в”њв”Ђв”Ђ domain/
в”‚   в”‚   в”њв”Ђв”Ђ __init__.py
в”‚   в”‚   в”њв”Ђв”Ђ log_levels.py
в”‚   в”‚   в””в”Ђв”Ђ log_entity.py
в”‚   в”њв”Ђв”Ђ configuration/
в”‚   в”‚   в”њв”Ђв”Ђ __init__.py
в”‚   в”‚   в”њв”Ђв”Ђ handler_configurator.py
в”‚   в”‚   в””в”Ђв”Ђ logger_config.py
```
## Usage
### Basic Example
```python
from lognet import Logger, LogLevel, LoggerConfig, ConsoleHandler, HandlerConfigurator


logger_config = LoggerConfig(min_level=LogLevel.DEBUG,
                             handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))

logger = Logger(logger_config)

logger.log(level=LogLevel.INFO, message="Example log message")
```

### Change format
```python
from lognet import Logger, LogLevel, LoggerConfig, ConsoleHandler, HandlerConfigurator


logger_config = LoggerConfig(log_format="[{time}] [{log_level}] {message}",
                             min_level=LogLevel.DEBUG,
                             handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))

logger = Logger(logger_config)

logger.log(level=LogLevel.INFO, message="Example log message")
logger.log(level=LogLevel.ERROR, message="Example error message")
```

### File Handler
```python
from lognet import Logger, LogLevel, LoggerConfig, HandlerConfigurator, FileHandler


logger_config = LoggerConfig(min_level=LogLevel.DEBUG,
                             handler_configurator=HandlerConfigurator(console_handler=FileHandler(file_name="log.txt")))

logger = Logger(logger_config)

logger.log(level=LogLevel.INFO, message="Example log message")
logger.log(level=LogLevel.ERROR, message="Example error message")
```
```

## Future updates
Ideas that I will try to implement
- multithreading
- async
- logging to database
- Filtration
- Settings for each message level separately
- Integration with metrics and tracing
- Support various output formats
- adding tags
- logging in json

## Connect with me/bug/request/suggestion
Check the FEEDBACK.md for information

## Documentation
Check the USAGE.md file for comprehensive examples and configuration details.

## Changelog
Review the CHANGELOG.md file for information on the latest updates and changes.

## License
This project is licensed under the MIT License - see the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Noloquideus/Lognet",
    "name": "lognet",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "lognet,logging,logger,log",
    "author": "Noloquideus",
    "author_email": "daniilmanukian@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/85/3d/6154fd5512c81e694fc530b20393191f1a12ee6863a84cf24b71e0addba9/lognet-3.0.2.tar.gz",
    "platform": null,
    "description": "![logo](logo.png)\r\n# Lognet\r\nLognet is a lightweight logging library for Python, designed to simplify the process of logging messages with different levels of severity. It provides an easy-to-use interface, customization options.\r\n\r\n## Features\r\n- Log Levels: Log messages with different severity levels, including DEBUG, INFO, WARNING, ERROR, and EXCEPTION.\r\n\r\n- Convenient log message formatting\r\n\r\n- Console and File Logging: Log messages to the console, a file, or both.\r\n\r\n# Installation\r\nInstall Lognet Logger using pip:\r\n\r\n```\r\npip install lognet\r\n```\r\n## ARCHITECTURE\r\n```bash\r\nlognet/\r\n\u0432\u201d\u201a\r\n\u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 core/\r\n\u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 __init__.py\r\n\u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 application/\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 __init__.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 logger.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 handlers/\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 handler.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 file_handler.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201d\u0432\u201d\u0402\u0432\u201d\u0402 console_handler.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 formatters/\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201d\u0432\u201d\u0402\u0432\u201d\u0402 log_formatter.py\r\n\u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 domain/\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 __init__.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 log_levels.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201d\u0432\u201d\u0402\u0432\u201d\u0402 log_entity.py\r\n\u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 configuration/\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 __init__.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u045a\u0432\u201d\u0402\u0432\u201d\u0402 handler_configurator.py\r\n\u0432\u201d\u201a   \u0432\u201d\u201a   \u0432\u201d\u201d\u0432\u201d\u0402\u0432\u201d\u0402 logger_config.py\r\n```\r\n## Usage\r\n### Basic Example\r\n```python\r\nfrom lognet import Logger, LogLevel, LoggerConfig, ConsoleHandler, HandlerConfigurator\r\n\r\n\r\nlogger_config = LoggerConfig(min_level=LogLevel.DEBUG,\r\n                             handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))\r\n\r\nlogger = Logger(logger_config)\r\n\r\nlogger.log(level=LogLevel.INFO, message=\"Example log message\")\r\n```\r\n\r\n### Change format\r\n```python\r\nfrom lognet import Logger, LogLevel, LoggerConfig, ConsoleHandler, HandlerConfigurator\r\n\r\n\r\nlogger_config = LoggerConfig(log_format=\"[{time}] [{log_level}] {message}\",\r\n                             min_level=LogLevel.DEBUG,\r\n                             handler_configurator=HandlerConfigurator(console_handler=ConsoleHandler()))\r\n\r\nlogger = Logger(logger_config)\r\n\r\nlogger.log(level=LogLevel.INFO, message=\"Example log message\")\r\nlogger.log(level=LogLevel.ERROR, message=\"Example error message\")\r\n```\r\n\r\n### File Handler\r\n```python\r\nfrom lognet import Logger, LogLevel, LoggerConfig, HandlerConfigurator, FileHandler\r\n\r\n\r\nlogger_config = LoggerConfig(min_level=LogLevel.DEBUG,\r\n                             handler_configurator=HandlerConfigurator(console_handler=FileHandler(file_name=\"log.txt\")))\r\n\r\nlogger = Logger(logger_config)\r\n\r\nlogger.log(level=LogLevel.INFO, message=\"Example log message\")\r\nlogger.log(level=LogLevel.ERROR, message=\"Example error message\")\r\n```\r\n```\r\n\r\n## Future updates\r\nIdeas that I will try to implement\r\n- multithreading\r\n- async\r\n- logging to database\r\n- Filtration\r\n- Settings for each message level separately\r\n- Integration with metrics and tracing\r\n- Support various output formats\r\n- adding tags\r\n- logging in json\r\n\r\n## Connect with me/bug/request/suggestion\r\nCheck the FEEDBACK.md for information\r\n\r\n## Documentation\r\nCheck the USAGE.md file for comprehensive examples and configuration details.\r\n\r\n## Changelog\r\nReview the CHANGELOG.md file for information on the latest updates and changes.\r\n\r\n## License\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A simple logger with a convenient log message format.",
    "version": "3.0.2",
    "project_urls": {
        "Homepage": "https://github.com/Noloquideus/Lognet"
    },
    "split_keywords": [
        "lognet",
        "logging",
        "logger",
        "log"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12c383465e0b9de418725c92265d5bc821abfadc8eb4b436c20f8830eee62bdd",
                "md5": "713ba88e8a7bb5a8d99f2f44389f7774",
                "sha256": "ccfb5f03a9d0d162a41f635a627a1f6d61fc65e084f7cdcb2e1dbb5265611042"
            },
            "downloads": -1,
            "filename": "lognet-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "713ba88e8a7bb5a8d99f2f44389f7774",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 10632,
            "upload_time": "2024-01-11T17:32:30",
            "upload_time_iso_8601": "2024-01-11T17:32:30.909407Z",
            "url": "https://files.pythonhosted.org/packages/12/c3/83465e0b9de418725c92265d5bc821abfadc8eb4b436c20f8830eee62bdd/lognet-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "853d6154fd5512c81e694fc530b20393191f1a12ee6863a84cf24b71e0addba9",
                "md5": "207f76e80f3ffc59aee74ccebbb82514",
                "sha256": "f3b2b742491cd2512cee9d67c09bda627c6d14f69ad12bf359c84f5c0aff12e6"
            },
            "downloads": -1,
            "filename": "lognet-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "207f76e80f3ffc59aee74ccebbb82514",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 8310,
            "upload_time": "2024-01-11T17:32:32",
            "upload_time_iso_8601": "2024-01-11T17:32:32.682426Z",
            "url": "https://files.pythonhosted.org/packages/85/3d/6154fd5512c81e694fc530b20393191f1a12ee6863a84cf24b71e0addba9/lognet-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 17:32:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Noloquideus",
    "github_project": "Lognet",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lognet"
}
        
Elapsed time: 0.20875s