Question
· Feb 25

Is the argument to $$$TRACE() always computed, or only when tracing is on?

We have some ObjectScript code in a custom business process:

When Log Trace Events is ticked on the business process in the Production view in the management portal, the argument is obviously computed.

Our question is whether the argument is computed when Log Trace Events is not ticked? Don't want to accidentally include something in a $$$TRACE() statement that takes enough computation to make a performance difference when released to production, even though the final output is not written to the event log.

A more general question is whether its possible to check the Log Trace Events status from ObjectScript, so you could do something like:

(Which is presumably what the $$$TRACE macro is doing under the surface...)

Product version: Caché 2018.1
$ZV: Cache for Windows (x86-64) 2018.1 (Build 184U) Wed Sep 19 2018 09:09:22 EDT
Discussion (3)3
Log in or sign up to continue

From Ensemble.inc:
 

#define TRACE(%arg)             $$$catTRACE("user",%arg)
#define sysTRACE(%arg)          $$$catTRACE("system",%arg)
#define catTRACE(%cat,%arg)     Do:$$$DoTrace ##class(Ens.Util.Trace).WriteTrace(%cat,$$$CurrentClass,$$$CurrentMethod,%arg)
#;
#define DoTrace                 $S($D($$$EnsJobLocal("DoTrace")):$$$EnsJobLocal("DoTrace"),1:##class(Ens.Util.Trace).DoTrace())
#;
#define EnsJobLocal         %Ensemble
#;
. . . . 
Class Ens.Util.Trace [ Abstract, ClassType = "", ProcedureBlock, System = 4 ]
{
ClassMethod DoTrace()
{
	Set tJobConfigName=$$$JobConfigName
	Quit $G($$$ConfigTrace(tJobConfigName),0)||(""'=$G($$$JobTraceDevice))||$$$IsTerminalDevice($IO)
}