LLoghelper


NameLLoghelper JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/atgczcl/LLoghelper
SummaryA helper module for logging.
upload_time2024-08-09 01:47:03
maintainerNone
docs_urlNone
authoratgczcl
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LLoghelper

#### 1.使用:

> pip install LLoghelper

#### 2.导入:

> ```python
> from LLoghelper.log_helper import log, logger
>
>
> ```

#### 3.控制日志log, print 是否可以打印  print=false恢复原样

```python
logger.set_log_enable(True, True)  
```

说明:

```python
 ''' 日志辅助类 
    Just: 
    pip install LLoghelper
    from LLoghelper.log_helper import log, logger
    支持log.info, print 等方法提供日志输出、格式设置、颜色设置等功能
    调用方法:
        log.info("This is a test.")
        log.warning("This is a warning.")
        log.error("This is an error.")
        log.critical("This is a critical error.")
        log.debug("This is a debug message.")
    替换原生的 print 函数, 并支持颜色输出:
        print("This is a test.")
        print("This is a critical test.", log_level=logger.CRITICAL)
        print("This is a warning test.", log_level=logger.WARNING)
        print("This is an error test.", log_level=logger.ERROR)
        print("This is a debug test.", log_level=logger.DEBUG)
        print("This is a info test.", log_level=logger.INFO)
    主要功能:
    1. 日志输出到控制台和文件
    2. 日志格式设置:simple, standard, simple_color, verbose, debug
    3. 日志颜色设置:red, green, yellow, blue, magenta, cyan, reset
    4. 日志级别设置:DEBUG, INFO, WARNING, ERROR, CRITICAL, NOTSET
    5. 日志打印控制:可以控制日志是否可以打印到控制台和文件

    '''
```

![image](./docs/screenshot.png)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/atgczcl/LLoghelper",
    "name": "LLoghelper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "atgczcl",
    "author_email": "atgzcl@163.com",
    "download_url": "https://files.pythonhosted.org/packages/61/d9/7787404e6f01a18b22c31472e9c988521c9ea84829201e96a2365ef17d3a/lloghelper-0.2.0.tar.gz",
    "platform": null,
    "description": "# LLoghelper\r\n\r\n#### 1.\u4f7f\u7528\uff1a\r\n\r\n> pip install LLoghelper\r\n\r\n#### 2.\u5bfc\u5165\uff1a\r\n\r\n> ```python\r\n> from LLoghelper.log_helper import log, logger\r\n>\r\n>\r\n> ```\r\n\r\n#### 3.\u63a7\u5236\u65e5\u5fd7log, print \u662f\u5426\u53ef\u4ee5\u6253\u5370  print=false\u6062\u590d\u539f\u6837\r\n\r\n```python\r\nlogger.set_log_enable(True, True)  \r\n```\r\n\r\n\u8bf4\u660e\uff1a\r\n\r\n```python\r\n ''' \u65e5\u5fd7\u8f85\u52a9\u7c7b \r\n    Just: \r\n    pip install LLoghelper\r\n    from LLoghelper.log_helper import log, logger\r\n    \u652f\u6301log.info, print \u7b49\u65b9\u6cd5\u63d0\u4f9b\u65e5\u5fd7\u8f93\u51fa\u3001\u683c\u5f0f\u8bbe\u7f6e\u3001\u989c\u8272\u8bbe\u7f6e\u7b49\u529f\u80fd\r\n    \u8c03\u7528\u65b9\u6cd5\uff1a\r\n        log.info(\"This is a test.\")\r\n        log.warning(\"This is a warning.\")\r\n        log.error(\"This is an error.\")\r\n        log.critical(\"This is a critical error.\")\r\n        log.debug(\"This is a debug message.\")\r\n    \u66ff\u6362\u539f\u751f\u7684 print \u51fd\u6570, \u5e76\u652f\u6301\u989c\u8272\u8f93\u51fa\uff1a\r\n        print(\"This is a test.\")\r\n        print(\"This is a critical test.\", log_level=logger.CRITICAL)\r\n        print(\"This is a warning test.\", log_level=logger.WARNING)\r\n        print(\"This is an error test.\", log_level=logger.ERROR)\r\n        print(\"This is a debug test.\", log_level=logger.DEBUG)\r\n        print(\"This is a info test.\", log_level=logger.INFO)\r\n    \u4e3b\u8981\u529f\u80fd\uff1a\r\n    1. \u65e5\u5fd7\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u548c\u6587\u4ef6\r\n    2. \u65e5\u5fd7\u683c\u5f0f\u8bbe\u7f6e\uff1asimple, standard, simple_color, verbose, debug\r\n    3. \u65e5\u5fd7\u989c\u8272\u8bbe\u7f6e\uff1ared, green, yellow, blue, magenta, cyan, reset\r\n    4. \u65e5\u5fd7\u7ea7\u522b\u8bbe\u7f6e\uff1aDEBUG, INFO, WARNING, ERROR, CRITICAL, NOTSET\r\n    5. \u65e5\u5fd7\u6253\u5370\u63a7\u5236\uff1a\u53ef\u4ee5\u63a7\u5236\u65e5\u5fd7\u662f\u5426\u53ef\u4ee5\u6253\u5370\u5230\u63a7\u5236\u53f0\u548c\u6587\u4ef6\r\n\r\n    '''\r\n```\r\n\r\n![image](./docs/screenshot.png)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A helper module for logging.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/atgczcl/LLoghelper"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56bbb705a9f14b6fb118464507967b899de83150fbde460d112902767ca9a4f7",
                "md5": "4803700626b095e96edce9f851c2835d",
                "sha256": "4203044af5dc8b0101c18ac5934f2312ddbc6a35ba718b430bfa58ec7357c500"
            },
            "downloads": -1,
            "filename": "LLoghelper-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4803700626b095e96edce9f851c2835d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10375,
            "upload_time": "2024-08-09T01:47:01",
            "upload_time_iso_8601": "2024-08-09T01:47:01.366901Z",
            "url": "https://files.pythonhosted.org/packages/56/bb/b705a9f14b6fb118464507967b899de83150fbde460d112902767ca9a4f7/LLoghelper-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61d97787404e6f01a18b22c31472e9c988521c9ea84829201e96a2365ef17d3a",
                "md5": "d4df9c330dd536f171e9b756e25c196d",
                "sha256": "591b60b089fb9f8d83038241c21da4708f4aa2c07ff66806a5da98cf25b1106d"
            },
            "downloads": -1,
            "filename": "lloghelper-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d4df9c330dd536f171e9b756e25c196d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 9163,
            "upload_time": "2024-08-09T01:47:03",
            "upload_time_iso_8601": "2024-08-09T01:47:03.102991Z",
            "url": "https://files.pythonhosted.org/packages/61/d9/7787404e6f01a18b22c31472e9c988521c9ea84829201e96a2365ef17d3a/lloghelper-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-09 01:47:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "atgczcl",
    "github_project": "LLoghelper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lloghelper"
}
        
Elapsed time: 0.29469s