SetTraceLevel method: OptEngine class
Syntax
SetTraceLevel(component, severity )
Description
SetTraceLevel sets the severity level at which events are logged for a given component.
When using the DetailedStatus OptEngine property, keep the following in mind:
-
The value returned by SetTraceLevel is the operational status of the optimization engine.
-
The DetailedStatus OptEngine property indicates the completion status of the OptEngine method call SetTraceLevel.
For example, SetTraceLevel can return %OptEng_Fail and DetailedStatus is %OptEng_DB_Updates_Pending. For SetTraceLevel, DetailedStatus can have the value:
-
%OptEng_Success: indicates that the function completed successfully.
-
%OptEng_Fail: indicates that the function failed.
-
%OptEng_Method_Disabled: indicates that the method is disabled or not valid.
-
%OptEng_DB_Updates_Pending: indicates that database updates are pending.
Parameters
| Parameter | Description |
|---|---|
|
component |
Use one of the following PeopleCode constants: Opt_Engine, Opt_Utility, Opt_Datacache, or Opt_Plugin. |
|
severity |
Use one of the following PeopleCode constants. These options set the degree to which errors are logged. You can set the tracing levels differently for various parts of your program. This enables you to control the amount of trace information that your program generates. The following list shows the order of the severity, starting with the highest level. For example, %Severity_Error logs %Severity_Fatal, %Severity_Status, and %Severity_Error messages, while the system filters out other messages. Keep in mind that the higher the severity, the greater the performance overhead.
|
Returns
This method returns a constant. Valid values are:
| Value | Description |
|---|---|
|
%OptEng_Success |
Returned if method succeeds. |
|
%OptEng_Fail |
Returned if the method fails. |
Example
Local OptEngine &myopt;
Local integer &status;
Local string &machname;
Local datetime &begindate;
Local datetime &enddate;
&myopt = GetOptEngine("PATSMITH");
&status = &myopt.SetTraceLevel(%Opt_Engine, %Severity_Warn);
if &status = %OptEng_Fail then
<example: notify user that set trace action has failed>
End-if;