TC.setLogLevel

Enables you to change the log level during script replay. To restore the initial log level setting, use TC.restoreLogLevel.

Note: Support for this API in JavaScript code will be deprecated in TruClient. Instead use the Evaluate C step available in the TruClient Steps box.

TC.setLogLevel(level, log_flags);

Arguments

Name Description
level

(string) Specify the log level. Possible values:

  • Disabled. Disables the log level. It still captures a log, including the error level.

  • Standard. Standard log captured.

  • Extended. Extended log file captured.

log_flags

(Optional)

(boolean) If the log level is set to extended, you can specify which data is captured using true/false flags as properties of json_object.

Flags include:

  • log_http

  • log_AUT

  • log_parameters

Any flag that is omitted is considered as false.

Return value

(void) undefined

Examples

Disable the log level:

Copy code
TC.setLogLevel(“Set the log level to “Disabled”);

Enable the standard log:

Copy code
TC.setLogLevel(“Standard”);

Enable the extended log, and specify which logs to capture:

Copy code

TC.setLogLevel(“Extended”,{ log_http : true, log_AUT: true, log_parameters: true});