CheeseLog


NameCheeseLog JSON
Version 1.1.4 PyPI version JSON
download
home_pageNone
Summary日志系统。可在控制台输出一定格式的、可选颜色的内容,并支持写入指定的日志文件。
upload_time2024-10-29 18:36:24
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords log logger
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # **CheeseLog**

## **介绍**

一款完全动态的日志系统,它有以下特点:

1. 多种的消息等级,可自定义添加新的等级。在打印与日志写入可以使用权重、指定消息或指定模块内的消息进行过滤,实现个性化的消息输出。

2. 支持控制台样式打印,有完善的样式体系可以直接使用,自定义的消息模版可以实现个性化的消息输出,在未有打印环境的情况下停止打印节省资源。

3. 支持日志文件记录,支持动态修改输出文件,可自由开启关闭。

4. 可以输出自定义格式的进度条,这对于一些下载或加载的控制台显示非常有帮助。

目前仍处于开发阶段,各种功能并不保证以后的支持。

## **安装**

系统要求:Linux。

Python要求:目前仅保证支持3.11及以上的python。

```bash
pip install CheeseLog
```

## **示例**

### **基本用法**

打印各种类型的Hello World,更多的内置方法请查看[Logger](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)。

```python
from CheeseLog import logger

logger.debug('Hello World')
logger.info('Hello World')
logger.warning('Hello World')
logger.danger('Hello World')
logger.error('Hello World')
```

### **样式打印**

更多样式请查看[Style](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Style.md)。

```python
from CheeseLog import logger

# 如果没有日志文件输出,可以在message直接使用样式
logger.debug('<green>Hello World</green>')

# 因为message会被记录到日志文件中
logger.debug('Hello World', '<green>Hello World</green>')

# 如果内容有'<'和'>'的组合,请对部分内容进行加密
logger.debug(logger.encode('<p>Hello World</p>'))
```

### **日志输出**

```python
from CheeseLog import logger

logger.filePath = './myLog.log'

logger.debug('Hello World')
# 中途修改输出日志是可以的
logger.filePath = './yourLog.log'
logger.debug('Hello World')
```

### **消息过滤**

更多消息过滤信息请看[Logger](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)。

更多消息等级信息请看[Level](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Level.md)。

```python
from CheeseLog import logger

logger.filePath = './myLog.log'
logger.weightFilter = 20 # 权重过滤,优先级最高
logger.levelFilter.add('DANGER') # 指定消息等级过滤,优先级其次
logger.moduleFilter['Xxx'] = 100 # 指定模块过滤,优先级最后
...
```

## **更多...**

### 1. [**Style**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Style.md)

### 2. [**Level**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Level.md)

### 3. [**Logger**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)

### 4. [**Progress Bar**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/ProgressBar.md)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "CheeseLog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "log, logger",
    "author": null,
    "author_email": "Cheese Unknown <cheese@cheese.ren>",
    "download_url": "https://files.pythonhosted.org/packages/29/fe/005f129364515e6bb22870edb7fdc090c95c37b6b39cd0d046316afbfa8e/cheeselog-1.1.4.tar.gz",
    "platform": null,
    "description": "# **CheeseLog**\n\n## **\u4ecb\u7ecd**\n\n\u4e00\u6b3e\u5b8c\u5168\u52a8\u6001\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u5b83\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a\n\n1. \u591a\u79cd\u7684\u6d88\u606f\u7b49\u7ea7\uff0c\u53ef\u81ea\u5b9a\u4e49\u6dfb\u52a0\u65b0\u7684\u7b49\u7ea7\u3002\u5728\u6253\u5370\u4e0e\u65e5\u5fd7\u5199\u5165\u53ef\u4ee5\u4f7f\u7528\u6743\u91cd\u3001\u6307\u5b9a\u6d88\u606f\u6216\u6307\u5b9a\u6a21\u5757\u5185\u7684\u6d88\u606f\u8fdb\u884c\u8fc7\u6ee4\uff0c\u5b9e\u73b0\u4e2a\u6027\u5316\u7684\u6d88\u606f\u8f93\u51fa\u3002\n\n2. \u652f\u6301\u63a7\u5236\u53f0\u6837\u5f0f\u6253\u5370\uff0c\u6709\u5b8c\u5584\u7684\u6837\u5f0f\u4f53\u7cfb\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u81ea\u5b9a\u4e49\u7684\u6d88\u606f\u6a21\u7248\u53ef\u4ee5\u5b9e\u73b0\u4e2a\u6027\u5316\u7684\u6d88\u606f\u8f93\u51fa\uff0c\u5728\u672a\u6709\u6253\u5370\u73af\u5883\u7684\u60c5\u51b5\u4e0b\u505c\u6b62\u6253\u5370\u8282\u7701\u8d44\u6e90\u3002\n\n3. \u652f\u6301\u65e5\u5fd7\u6587\u4ef6\u8bb0\u5f55\uff0c\u652f\u6301\u52a8\u6001\u4fee\u6539\u8f93\u51fa\u6587\u4ef6\uff0c\u53ef\u81ea\u7531\u5f00\u542f\u5173\u95ed\u3002\n\n4. \u53ef\u4ee5\u8f93\u51fa\u81ea\u5b9a\u4e49\u683c\u5f0f\u7684\u8fdb\u5ea6\u6761\uff0c\u8fd9\u5bf9\u4e8e\u4e00\u4e9b\u4e0b\u8f7d\u6216\u52a0\u8f7d\u7684\u63a7\u5236\u53f0\u663e\u793a\u975e\u5e38\u6709\u5e2e\u52a9\u3002\n\n\u76ee\u524d\u4ecd\u5904\u4e8e\u5f00\u53d1\u9636\u6bb5\uff0c\u5404\u79cd\u529f\u80fd\u5e76\u4e0d\u4fdd\u8bc1\u4ee5\u540e\u7684\u652f\u6301\u3002\n\n## **\u5b89\u88c5**\n\n\u7cfb\u7edf\u8981\u6c42\uff1aLinux\u3002\n\nPython\u8981\u6c42\uff1a\u76ee\u524d\u4ec5\u4fdd\u8bc1\u652f\u63013.11\u53ca\u4ee5\u4e0a\u7684python\u3002\n\n```bash\npip install CheeseLog\n```\n\n## **\u793a\u4f8b**\n\n### **\u57fa\u672c\u7528\u6cd5**\n\n\u6253\u5370\u5404\u79cd\u7c7b\u578b\u7684Hello World\uff0c\u66f4\u591a\u7684\u5185\u7f6e\u65b9\u6cd5\u8bf7\u67e5\u770b[Logger](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)\u3002\n\n```python\nfrom CheeseLog import logger\n\nlogger.debug('Hello World')\nlogger.info('Hello World')\nlogger.warning('Hello World')\nlogger.danger('Hello World')\nlogger.error('Hello World')\n```\n\n### **\u6837\u5f0f\u6253\u5370**\n\n\u66f4\u591a\u6837\u5f0f\u8bf7\u67e5\u770b[Style](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Style.md)\u3002\n\n```python\nfrom CheeseLog import logger\n\n# \u5982\u679c\u6ca1\u6709\u65e5\u5fd7\u6587\u4ef6\u8f93\u51fa\uff0c\u53ef\u4ee5\u5728message\u76f4\u63a5\u4f7f\u7528\u6837\u5f0f\nlogger.debug('<green>Hello World</green>')\n\n# \u56e0\u4e3amessage\u4f1a\u88ab\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d\nlogger.debug('Hello World', '<green>Hello World</green>')\n\n# \u5982\u679c\u5185\u5bb9\u6709'<'\u548c'>'\u7684\u7ec4\u5408\uff0c\u8bf7\u5bf9\u90e8\u5206\u5185\u5bb9\u8fdb\u884c\u52a0\u5bc6\nlogger.debug(logger.encode('<p>Hello World</p>'))\n```\n\n### **\u65e5\u5fd7\u8f93\u51fa**\n\n```python\nfrom CheeseLog import logger\n\nlogger.filePath = './myLog.log'\n\nlogger.debug('Hello World')\n# \u4e2d\u9014\u4fee\u6539\u8f93\u51fa\u65e5\u5fd7\u662f\u53ef\u4ee5\u7684\nlogger.filePath = './yourLog.log'\nlogger.debug('Hello World')\n```\n\n### **\u6d88\u606f\u8fc7\u6ee4**\n\n\u66f4\u591a\u6d88\u606f\u8fc7\u6ee4\u4fe1\u606f\u8bf7\u770b[Logger](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)\u3002\n\n\u66f4\u591a\u6d88\u606f\u7b49\u7ea7\u4fe1\u606f\u8bf7\u770b[Level](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Level.md)\u3002\n\n```python\nfrom CheeseLog import logger\n\nlogger.filePath = './myLog.log'\nlogger.weightFilter = 20 # \u6743\u91cd\u8fc7\u6ee4\uff0c\u4f18\u5148\u7ea7\u6700\u9ad8\nlogger.levelFilter.add('DANGER') # \u6307\u5b9a\u6d88\u606f\u7b49\u7ea7\u8fc7\u6ee4\uff0c\u4f18\u5148\u7ea7\u5176\u6b21\nlogger.moduleFilter['Xxx'] = 100 # \u6307\u5b9a\u6a21\u5757\u8fc7\u6ee4\uff0c\u4f18\u5148\u7ea7\u6700\u540e\n...\n```\n\n## **\u66f4\u591a...**\n\n### 1. [**Style**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Style.md)\n\n### 2. [**Level**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Level.md)\n\n### 3. [**Logger**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/Logger.md)\n\n### 4. [**Progress Bar**](https://github.com/CheeseUnknown/CheeseLog/blob/master/documents/ProgressBar.md)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "\u65e5\u5fd7\u7cfb\u7edf\u3002\u53ef\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u4e00\u5b9a\u683c\u5f0f\u7684\u3001\u53ef\u9009\u989c\u8272\u7684\u5185\u5bb9\uff0c\u5e76\u652f\u6301\u5199\u5165\u6307\u5b9a\u7684\u65e5\u5fd7\u6587\u4ef6\u3002",
    "version": "1.1.4",
    "project_urls": {
        "Source": "https://github.com/CheeseUnknown/CheeseLog"
    },
    "split_keywords": [
        "log",
        " logger"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff8e84b90cc82e67ca8a584d9e967b8f966a3183b023ef05d9c0bca0b006c9aa",
                "md5": "6702b1c1b26ffbda62658be1a8df18fa",
                "sha256": "96c67e0f02065711bb3d3a4b138858a871dbaf34ed98450fe935b24d44b6ff50"
            },
            "downloads": -1,
            "filename": "cheeselog-1.1.4-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6702b1c1b26ffbda62658be1a8df18fa",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 8224,
            "upload_time": "2024-10-29T18:36:22",
            "upload_time_iso_8601": "2024-10-29T18:36:22.335069Z",
            "url": "https://files.pythonhosted.org/packages/ff/8e/84b90cc82e67ca8a584d9e967b8f966a3183b023ef05d9c0bca0b006c9aa/cheeselog-1.1.4-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29fe005f129364515e6bb22870edb7fdc090c95c37b6b39cd0d046316afbfa8e",
                "md5": "fd3b6d4a015b66d841d941a15ed1908e",
                "sha256": "e38299839c1a6fa803cf1f28233eb411ffd8aecfe813a91bade890eeff67ed46"
            },
            "downloads": -1,
            "filename": "cheeselog-1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "fd3b6d4a015b66d841d941a15ed1908e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6510,
            "upload_time": "2024-10-29T18:36:24",
            "upload_time_iso_8601": "2024-10-29T18:36:24.142852Z",
            "url": "https://files.pythonhosted.org/packages/29/fe/005f129364515e6bb22870edb7fdc090c95c37b6b39cd0d046316afbfa8e/cheeselog-1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 18:36:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CheeseUnknown",
    "github_project": "CheeseLog",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cheeselog"
}
        
Elapsed time: 0.99054s