Skip to content

saltycrane/trace-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

  • pip install -e git:https://github.com/saltycrane/trace-tools.git#egg=trace_tools

Usage

from trace_tools.decorators import trace

@trace()
def some_function_to_trace(arg):
    do_something()

@trace(max_level=2)
def some_function_to_trace(arg):
    do_something()

@another_decorator
@trace(
    max_level=4,
    ignore=(
        'httplib', 'logging', 'ssl', 'email', 'encodings', 'gzip', 'urllib',
        'multiprocessing', 'django', 'cgi', 'requests', 'cookielib', 'base64',
        'slumber', 'zipfile', 'redis'))
def some_other_function():
    do_something_else()

@trace(max_level=10, calls_only=False, ignore=('debugtools', 'blessings', 'ipdb', 'IPython',), ignore_builtins=True, ignore_stdlib=True)
def process(self, content):
    do_stuff()

@trace(max_level=115, calls_only=True, ignore=(
        'suds.resolver',
        'suds.sudsobject',
        'suds.xsd',
        'debugtools', 'blessings', 'ipdb', 'IPython',),
       ignore_builtins=True, ignore_stdlib=True)
def process(self, content):
    do_stuff()

@trace(
    ignore=[
        'myapp.noisy',
    ],
    keep=[
        'myapp',
    ],
    calls_only=True,
)
def devserver():
    do_stuff()

Notes

  • When using with a local development web server (e.g. Django, Flask), make sure the auto reloader is disabled.

Releases

No releases published

Packages

No packages published

Languages