Trace
The trace action is listed below.
Syntax
Trace(level:Integer, message:String, argument:Literal, ...) : VoidType
Where:
- The level is comprised between 1 and 9 and is used to indent the traces.
- The message is used like a message function.
- The argument must have the same number of # and parameters. If there are more parameters than #, parameters are added at the end of the message. If there are more # than parameters, the character # is not replaced.
- The | symbol lets you insert a carriage return in a prompt.
- # is replaced with the parameter value.
To activate traces:
- modify the logback.xml file located in
WEB-INF/classes
- Add
logger
tags. The other tags are compulsory but the ones provided in the example below are examples only.
<configuration ... >
<!-- logback.xml -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d [%thread] %-5level %logger{15} - %msg%n</pattern>
</encoder>
</appender>
<!-- basic traces -->
<logger name="CKE_CUSTO_TRACES" level="DEBUG"><appender-ref ref="STDOUT"/></logger>
<!-- extended traces
<logger name="CKE_CUSTO_TRACES_Verbose" level="DEBUG"><appender-ref ref="STDOUT"/></logger>
-->
<root level="OFF"/>
</configuration>
The text provided to the Trace()
function is displayed
on the server side in the application server console. You can also display it through the
logger name CKE_EKL_TRACE in debug mode, for example:
<logger name="CKE_EKL_TRACE" level="DEBUG"><appender-ref
ref="STDOUT"/></logger>
. The traces are only used for debug purposes.
Arguments
String | Required/Optional | Description | Comment |
---|---|---|---|
level |
Required | comprised between 1 and 9 and is used to indent the traces | |
message |
Required | The message is used like a message function | You must put a String in quotes. |
argument |
Required | The argument must have the same number of # and parameters. If there are more parameters than #, parameters are added at the end of the message. If there are more # than parameters, the character # is not replaced. |
- The | symbol lets you insert a carriage return in a prompt.
- # is replaced with the parameter value.
Example
Trace(1,"this is a trace")
Profile Card
Function.Signature = Trace@Integer@String@Literal@... Function.Visibility = Visible Function.Arg1 = LocalCPU Function.Arg2 = LocalCPU Function.Arg3 = LocalCPU