project-lux / lux-marklogic

Code, issues, and resources related to LUX MarkLogic
Other
3 stars 2 forks source link

Make Trace Statements Conditional (from 1122) #46

Open gigamorph opened 4 months ago

gigamorph commented 4 months ago

Problem Description: We have trace statements throughout the code that log information from Marklogic for debugging and analysis. We can turn these trace events on and off to enable or disable logging for those events. However, even if a trace event is turned off, the lines of code needed to generate those trace strings may still be evaluated, which could impact performance. In some cases, we only evaluate trace event code if that trace event is enabled. But this is not the case in all of our code. It would be better if this rule was followed everywhere.

Expected Behavior/Solution: Surround trace calls with if statements so that they are only evaluated when the trace event is enabled.

Requirements:

Needed for promotion:

- [ ] Wireframe/Mockup - Heather - [ ] Committee discussions - Sarah - [ ] Feasibility/Team discussion - Sarah - [ ] Backend requirements - TBD - [ ] Frontend requirements- TBD - [ ] Questions - List of questions for discussions. Answers should be documented within the issue.

UAT/LUX Examples:

The best way to test is to do a grep for all instances of xdmp.trace in the code, and see if all of those lines of code are surrounded by an if statement.

Dependencies/Blocks:

Related Github Issues:

Related links:

Wireframe/Mockup: