How to use the pysnooper.tracer.MAX_VARIABLE_LENGTH function in PySnooper

To help you get started, we’ve selected a few PySnooper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ydf0509 / distributed_framework / function_scheduling_distributed_framework / utils / custom_pysnooper.py View on Github external
def patch_snooper_max_variable_length(max_lenth=100000):
    """
    提供一个猴子补丁,三方包默认是变量最大显示100个字母,对于我这种经常debug对接方json的,要加到10万才能显示一个josn。
    最好是放在name = main中去执行此补丁,否则由于模块是单例的永远只导入一次,会改变其他地方的运行表现。
    :param max_lenth:
    :return:
    """
    from pysnooper import tracer
    tracer.MAX_VARIABLE_LENGTH = max_lenth