semvec/pypi-packages huggingface dataset:
scratch-pad-py 0.0.17
python logger libary
Requires Python: >=3.9
Keywords: logger

# scratch-pad-py

## Projects that have been ported below.
https://github.com/polonaiz/scratch-pad


mind blowing python toolset. why not pr?


# Logger interface
```
import LoggerInterface

class Logger(LoggerInterface):
    logger: LoggerInterface = None

    @classmethod
    def setLogger(cls, logger: LoggerInterface):
        cls.logger = logger

    @classmethod
    def getLogger(cls) -> LoggerInterface:
        return cls.logger

    @classmethod
    def info(cls, message: dict, option: dict = {}):
        cls.logger.info(message, option)

    @classmethod
    def notice(cls, message: dict, option: dict = {}):
        cls.logger.notice(message, option)

    @classmethod
    def warning(cls, message: dict, option: dict = {}):
        cls.logger.warning(message, option)

    @classmethod
    def error(cls, message: dict, option: dict = {}):
        cls.logger.error(message, option)

    @classmethod
    def critical(cls, message: dict, option: dict = {}):
        cls.logger.critical(message, option)
```



# Usage
FileLogger
```
filePath = "/tmp/scratch-pad-python.log"
logger = FileLogger(
    config={
        "filePath": filePath,
        "truncate": True
    }
)
message = {
    "type": "file",
    "message": "hello world"
}
logger.info(message)
```
CompositeLogger
```
consoleLogger = ConsoleLogger(
        config={
        "appendNewLine": 1
    }
)
memoryLogger = MemoryLogger()
memoryLoggerCompositeFilter = CompositeLogger.getSelectorLevel(["info", "error"])

message = {
    "type": "composite",
    "message": "hello world"
}

compositLogger = CompositeLogger(
    config={
        "defaults": {
            "datetime": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
            "program": "scratch-pad-python",
        },
        "loggerFilterPairs": [
            {
                "logger": consoleLogger,
                "filter": None
            },
            {
                "logger": memoryLogger,
                "filter": memoryLoggerCompositeFilter
            }
        ],
    }
)

compositLogger.info(message)
```

JandiLogger
```
url = "url"
logger = JandiLogger(
    url=url
)

message = {
    "type": "jandi",
    "message": "hello world"
}

logger.info(message)
```

TelegramLogger
```
token = "telegram"
chat_id = 1234

message = {
    "type": "telegram",
    "message": "hello world",
}

logger = TelegramLogger(
    chat_id=chat_id,
    token=token,
)

logger.info(message)
```

FluentLogger
```
logger = FluentLogger()
message = {
        "type": "fluent",
        "message": "hello world"
    }

logger.info(message)
```

#
stuff) 


scribe-docker for ScribeLogger : https://hub.docker.com/r/polonaiz/facebook-scribe


fluent-docker for FluentLogger : https://github.com/chirichidi/fluent-docker/tree/main
apachecn-makelove 2022.7.27.0
坏男孩日记
Requires Python: >=3.6

<!--
    需要填充的占位符：
    
    README.md
    
        {name}：文档中文名
        {nameEn}：文档英文名
        {urlEn}：文档原始链接
        {domain}：域名前缀
        {adminName}：负责人名称
        {adminUn}：负责人 Github 用户名
        {adminQq}：负责人 QQ
        {repo}：ApacheCN 的 Github 仓库名称
        {dockerName}：DockerHub 仓库名称
        {pypiName}：PYPI 包名称
        {npmName}：NPM 包名称
    
    CNAME
    
        {domain}：域名前缀

    index.html
    
        {name}：文档中文名
        {color}：显示颜色
        {repo}：ApacheCN 的 Github 仓库名称

    asset/docsify-apachecn-footer.js
    
        {repo}：ApacheCN 的 Github 仓库名称
-->

# 坏男孩日记

> 原文：[{nameEn}]({urlEn})
> 
> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 新时代需要新道德。——《三体》

* [在线阅读](https://makelove.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/makelove/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)

## 贡献指南

这本日记用于记录有趣的人与事。

后续慢慢展开 ..

> 线上慢慢迁移到线下

通过几个活跃的人，开启线上的活动。

然后通过催化，让周围的人达到活跃地步，达成活跃。

在开始线下的活动转型。

## 联系方式

### 负责人

* [绿帽哥](https://github.com/ChrisPaul234): 绿帽哥

### 其他

*   在我们的 [apachecn/MakeLove](https://github.com/apachecn/MakeLove) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](https://www.apachecn.org/#/docs/join) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/apachecn-makelove
docker run -tid -p <port>:80 apachecn0/apachecn-makelove
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install apachecn-makelove
apachecn-makelove <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g apachecn-makelove
apachecn-makelove <port>
# 访问 http://localhost:{port} 查看文档
```

## 其它协议

霞鹜文楷采用 [SIL 开放字体协议 1.1](https://github.com/lxgw/LxgwWenKai/blob/main/SIL_Open_Font_License_1.1.txt)。

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)