You need to sign in to do that
Don't have an account?
Vladimir G
Class and Trigger Trace Overrides are ignoring constructors
Hi,
When I'm trying to override trace flags for a class - everything looks fine except of constructors.
For example I have such DummyClass:
Global Trace for the user is set to DEBUG everywhere and for DummyClass it's set to FINEST everywhere.
Here's what I get in the debug log:
The same applies for a static constructors.
I've tried to search for this in the Known Bugs, but no luck.
Any ideas how to workaround this (without changing the code itself) or how to bring SF's attention to fix this issue?
Thanks,
Vladimir
When I'm trying to override trace flags for a class - everything looks fine except of constructors.
For example I have such DummyClass:
public virtual class DummyClass { public DummyClass(String test) { System.debug('Called DummyClass constructor with '+test+' parameter'); Void_Method_Without_Params(); } public void Void_Method_Without_Params() { System.debug('DummyClass.Void_Method_Without_Params'); } /* And lots of other static methods */ }And such unit test:
@istest public class MethodCalls { public static testmethod void Test_Inner_Static_Methods_Calls() { DummyClass obj=new DummyClass('Testing constructor'); /* Lots of DummyClass static and instance methods calls */ }
Global Trace for the user is set to DEBUG everywhere and for DummyClass it's set to FINEST everywhere.
Here's what I get in the debug log:
34.0 APEX_CODE,DEBUG;APEX_PROFILING,DEBUG;CALLOUT,DEBUG;DB,DEBUG;SYSTEM,DEBUG;VALIDATION,DEBUG;VISUALFORCE,DEBUG;WORKFLOW,DEBUG 06:23:02.0 (64084)|EXECUTION_STARTED 06:23:02.0 (136558)|CODE_UNIT_STARTED|[EXTERNAL]|01p36000001UZUF|MethodCalls.Test_Inner_Static_Methods_Calls 06:23:02.0 (8498670)|USER_DEBUG|[55]|DEBUG|Called DummyClass constructor with Testing constructor parameter 06:23:02.0 (8595762)|PUSH_TRACE_FLAGS|[56]|01p36000001UXWj|DummyClass|APEX_CODE,FINEST;APEX_PROFILING,FINEST;CALLOUT,FINEST;DB,FINEST;SYSTEM,FINEST;VALIDATION,FINEST;VISUALFORCE,FINEST;WORKFLOW,FINEST 06:23:02.0 (8610577)|METHOD_ENTRY|[56]|01p36000001UXWj|DummyClass.Void_Method_Without_Params() 06:23:02.0 (8639280)|VARIABLE_SCOPE_BEGIN|[63]|this|DummyClass|true|false 06:23:02.0 (8695301)|VARIABLE_ASSIGNMENT|[63]|this|{"AutoField":1}|0x29c5dd7d 06:23:02.0 (8708182)|STATEMENT_EXECUTE|[63] 06:23:02.0 (8710219)|STATEMENT_EXECUTE|[64] 06:23:02.0 (8712590)|LIMIT_USAGE|[64]|SCRIPT_STATEMENTS|10|200000 06:23:02.0 (8719003)|HEAP_ALLOCATE|[64]|Bytes:37 06:23:02.0 (8737361)|SYSTEM_METHOD_ENTRY|[64]|System.debug(ANY) 06:23:02.0 (8754229)|USER_DEBUG|[64]|DEBUG|DummyClass.Void_Method_Without_Params 06:23:02.0 (8760422)|SYSTEM_METHOD_EXIT|[64]|System.debug(ANY) 06:23:02.0 (8766224)|METHOD_EXIT|[56]|01p36000001UXWj|DummyClass.Void_Method_Without_Params() 06:23:02.0 (8785480)|POP_TRACE_FLAGS|[56]|01p36000001UXWj|DummyClass|APEX_CODE,DEBUG;APEX_PROFILING,DEBUG;CALLOUT,DEBUG;DB,DEBUG;SYSTEM,DEBUG;VALIDATION,DEBUG;VISUALFORCE,DEBUG;WORKFLOW,DEBUGAs you may notice in the line below:
06:23:02.0 (8498670)|USER_DEBUG|[55]|DEBUG|Called DummyClass constructor with Testing constructor parameterThere's a direct User_Debug entry - without any PUSH_TRACE_FLAGS, Method/Constructor entries, statement executes and so on. So this means that all the code in the DummyClass constructor was executed with the DEBUG level. However when constructor calls another method - everything gets fine and FINEST levels are applied for that method, but nor for the constructor...
The same applies for a static constructors.
I've tried to search for this in the Known Bugs, but no luck.
Any ideas how to workaround this (without changing the code itself) or how to bring SF's attention to fix this issue?
Thanks,
Vladimir
Vladimir G
+ Also the same situation is with the static fields - their initialization and assignment (see an example below) is also not logged with the proper Trace level.