LogAssist


NameLogAssist JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/horrible-gh/LogAssist.git
SummaryA simple and customizable logging library for Python.
upload_time2024-06-14 07:40:12
maintainerNone
docs_urlNone
authorhorrible-gh
requires_python>=3.6
licenseNone
keywords logassist log assist logassist log assist logger logger
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LogAssist

A simple and customizable logging library for Python.

## Installation

```powershell
pip install LogAssist
```

## Features

- Easy to use and configure
- Supports multiple log levels (debug, info, warning, error)
- Outputs log messages to both console and file
- Allows for log file removal on initialization
- Provides datetime formatting for log messages

## Usage

1. Import the Logger class:

```python
from LogAssist.log import Logger
```

2. Initialize the logger with your desired settings:

```python
Logger.init(log_level='verbose', dir_name='./log', file_name='my_log.log', prev_log_remove=True, out_console=True, out_file=True)
# or
Logger.init()
```

3. Use the logger in your code:

```python
Logger.verbose('MyTag', 'This is a verbose message')
Logger.debug('MyTag', 'This is a debug message')
Logger.info('MyTag', 'This is an info message')
Logger.warning('MyTag', 'This is a warning message')
Logger.error('MyTag', 'This is an error message', exc_info=sys.exc_info())
```

## Configuration

You can configure the logger using the init method or by passing a dictionary of logger information to the logger_init method. The available options are:

- log_level: The log level to set (verbose, debug, info, warning, or error). Default is 'verbose'.
- dir_name: The directory name to use for log files. Default is './log'.
- file_name: The file name to use for logging. Default is None, which will create a file named "Logger.log".
- prev_log_remove: Whether to remove the existing log file on initialization. Default is False.
- out_console: Whether to output log messages to the console. Default is True.
- out_file: Whether to output log messages to a file. Default is True.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/horrible-gh/LogAssist.git",
    "name": "LogAssist",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "LogAssist, Log Assist, logassist, log assist, Logger, logger",
    "author": "horrible-gh",
    "author_email": "horrible <shinjpn1@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7f/31/649877458834f23a3241f55cda8d354495533876de78a154255b67c28946/LogAssist-1.1.0.tar.gz",
    "platform": null,
    "description": "# LogAssist\r\n\r\nA simple and customizable logging library for Python.\r\n\r\n## Installation\r\n\r\n```powershell\r\npip install LogAssist\r\n```\r\n\r\n## Features\r\n\r\n- Easy to use and configure\r\n- Supports multiple log levels (debug, info, warning, error)\r\n- Outputs log messages to both console and file\r\n- Allows for log file removal on initialization\r\n- Provides datetime formatting for log messages\r\n\r\n## Usage\r\n\r\n1. Import the Logger class:\r\n\r\n```python\r\nfrom LogAssist.log import Logger\r\n```\r\n\r\n2. Initialize the logger with your desired settings:\r\n\r\n```python\r\nLogger.init(log_level='verbose', dir_name='./log', file_name='my_log.log', prev_log_remove=True, out_console=True, out_file=True)\r\n# or\r\nLogger.init()\r\n```\r\n\r\n3. Use the logger in your code:\r\n\r\n```python\r\nLogger.verbose('MyTag', 'This is a verbose message')\r\nLogger.debug('MyTag', 'This is a debug message')\r\nLogger.info('MyTag', 'This is an info message')\r\nLogger.warning('MyTag', 'This is a warning message')\r\nLogger.error('MyTag', 'This is an error message', exc_info=sys.exc_info())\r\n```\r\n\r\n## Configuration\r\n\r\nYou can configure the logger using the init method or by passing a dictionary of logger information to the logger_init method. The available options are:\r\n\r\n- log_level: The log level to set (verbose, debug, info, warning, or error). Default is 'verbose'.\r\n- dir_name: The directory name to use for log files. Default is './log'.\r\n- file_name: The file name to use for logging. Default is None, which will create a file named \"Logger.log\".\r\n- prev_log_remove: Whether to remove the existing log file on initialization. Default is False.\r\n- out_console: Whether to output log messages to the console. Default is True.\r\n- out_file: Whether to output log messages to a file. Default is True.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple and customizable logging library for Python.",
    "version": "1.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/horrible-gh/Logger/issues",
        "Homepage": "https://github.com/horrible-gh/Logger"
    },
    "split_keywords": [
        "logassist",
        " log assist",
        " logassist",
        " log assist",
        " logger",
        " logger"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66a1be3e31d5677d45c104cb365441cb4e83dca0c4560be1d2bd4f8f69386a05",
                "md5": "44b14eea5bbbc9f6bcdb2a4778ea2b92",
                "sha256": "a923ac5e6b7d9a37a940d023372f17a3a1b0e69d59a5ecb9e0aa0ea78f100a1c"
            },
            "downloads": -1,
            "filename": "LogAssist-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44b14eea5bbbc9f6bcdb2a4778ea2b92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4113,
            "upload_time": "2024-06-14T07:40:10",
            "upload_time_iso_8601": "2024-06-14T07:40:10.843084Z",
            "url": "https://files.pythonhosted.org/packages/66/a1/be3e31d5677d45c104cb365441cb4e83dca0c4560be1d2bd4f8f69386a05/LogAssist-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f31649877458834f23a3241f55cda8d354495533876de78a154255b67c28946",
                "md5": "9e5a4e851d570af233bcc34481aef173",
                "sha256": "2dbd8198a72f02d8dfca03410c360639992272d73a19546a2e0cd35e6a5a5ceb"
            },
            "downloads": -1,
            "filename": "LogAssist-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9e5a4e851d570af233bcc34481aef173",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4057,
            "upload_time": "2024-06-14T07:40:12",
            "upload_time_iso_8601": "2024-06-14T07:40:12.563803Z",
            "url": "https://files.pythonhosted.org/packages/7f/31/649877458834f23a3241f55cda8d354495533876de78a154255b67c28946/LogAssist-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 07:40:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "horrible-gh",
    "github_project": "LogAssist",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "logassist"
}
        
Elapsed time: 0.29446s