X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=aspects%2F__init__.py;fp=aspects%2F__init__.py;h=1df5a9f08870e6fa2b4c2e1285b590ab1eff8556;hb=661935147a055b7c1b35c21292568e10161887dd;hp=bcce3bc7a23eafdedec78b29476caffa50cdffa8;hpb=6bd763b169c1ef7c6eff6b34f9f7877a4d9afdfa;p=plcapi.git diff --git a/aspects/__init__.py b/aspects/__init__.py index bcce3bc..1df5a9f 100644 --- a/aspects/__init__.py +++ b/aspects/__init__.py @@ -6,11 +6,15 @@ from PLC.Method import Method from aspects.omfaspects import OMFAspect -def apply_aspects(): - - # TEST - #from pyaspects.debuggeraspect import DebuggerAspect - #weave_class_method(DebuggerAspect(out=open("/tmp/all_method_calls.log", "a")), Method, "__call__") +def apply_omf_aspect(): # track all PLC methods to add OMF hooks weave_class_method(OMFAspect(), Method, "__call__") + + +def apply_debugger_aspect(): + # just log all method calls w/ their parameters + from pyaspects.debuggeraspect import DebuggerAspect + weave_class_method(DebuggerAspect(out=open("/tmp/all_method_calls.log", "a")), Method, "__call__") + +