Skip to main content

好爸爸的每个类都是被用来继承的。作为顶层设计,它为通用行为实现了最基础的标准实践。比如自动埋点、权限控制、性能分析、任务流转、异常处理、单元测试等。

Project description

继承TaskBase,可以实现子类方法的自动埋点和错误统计等功能.本次更新如下:

  • 方法出现异常后,会自动记录错误,而不是使整个程序崩溃.
  • 本次增加了将日志输出到本地文件。

使用示例:

from taskbase import TaskBase
import time

class testSubClass(TaskBase):
    def my_method(self, arg1, arg2, arg3):
        time.sleep(0.5)
        print("猜猜看,父类做了些什么?")

    def error_test(self):
        time.sleep(1.2)
        try:
            print(1/0)            
        except Exception as e:
            print(e)
        print(1/0)
        print("hello")

a=testSubClass()
a.my_method(10086,time,"第三个参数")
a.error_test()

输出显示:

猜猜看父类做了些什么
2023-05-17 16:27:50     0.500s  TaskBase.testSubClass.my_method(10086, <module 'time' (, 第三个参数)
division by zero
2023-05-17 16:27:52     testSubClass.error_test()出现异常:       division by zero
2023-05-17 16:27:51     1.200s  TaskBase.testSubClass.error_test()

友情链接

名称 链接
markdown语法 https://daringfireball.net/projects/markdown/
PowerShell 7 https://github.com/PowerShell/PowerShell/releases
P语义化版本 https://semver.org/lang/zh-CN/

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

baba-0.1.8.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

baba-0.1.8-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file baba-0.1.8.tar.gz.

File metadata

  • Download URL: baba-0.1.8.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for baba-0.1.8.tar.gz
Algorithm Hash digest
SHA256 3ce82f93f2ee3d830885e52460f6a16c484f5550bb721967740b944643ed9362
MD5 0232c7f72c8bc234b41074fcb31e2004
BLAKE2b-256 c231ff7b2f59c0df0753f1b244155b3d5278157f8756b14581282b388c257105

See more details on using hashes here.

File details

Details for the file baba-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: baba-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for baba-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 39c34b61d2fe12ce1c94fadb2904bcd503110d0dece15b4f6011f22a26aec236
MD5 448026d8a50a3a70bea401daec5bdcfa
BLAKE2b-256 201c1df307f4b003ee66ebf310b0d4e03a338de7932f2bf5644808951f75e93b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page