PaddleOCR-RPC
Project description
FunnyLog
一个简单易用、功能强大的日志工具。
只需要加一个装饰器,就能自动日志输出类里面所有的方法的功能说明。
Documentation: https://funny-dream.github.io/funnylog
Source Code: https://github.com/funny-dream/funnylog
安装
pip install funnylog
使用说明
from funnylog import logger
from funnylog import log
from funnylog.conf import setting
setting.CLASS_NAME_ENDSWITH = ("Log",)
logger("DEBUG")
class BaseLog:
def base_self_method(self):
"""我是 基类 里面的实例方法"""
@classmethod
def base_cls_method(self):
"""我是 基类 里面的类方法"""
@staticmethod
def base_static_method():
"""我是 基类 里面的静态方法"""
# 注意这里,只需要在这里挂一个装饰器
@log
class TestLog(BaseLog):
"""继承了基类BaseLog"""
def self_method(self):
"""我是 类 里面的实例方法"""
@classmethod
def cls_method(self):
"""我是 类 里面的类方法"""
@staticmethod
def static_method():
"""我是 类 里面的静态方法"""
if __name__ == '__main__':
# @log装饰器自动打印
TestLog().self_method()
TestLog().cls_method()
TestLog().static_method()
# 直接调用基类里面的方法,也能自动打印
TestLog().base_self_method()
TestLog().base_cls_method()
TestLog().base_static_method()
终端输出效果:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
funnylog-2023.8.23.tar.gz
(11.0 kB
view hashes)
Built Distribution
Close
Hashes for funnylog-2023.8.23-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 714d3411b57288f1ef765ed5ae4e26d54627d2315159526d6a1a84a6fedcf7ea |
|
MD5 | 4f418dbacccdd8c4483603eaa922ef26 |
|
BLAKE2b-256 | a12c005b78edb1b6cd5cb72d922c6613e6945835cd5c14a432bec80b26ccb2eb |