api trace - SAP-archive/xsk GitHub Wiki

$.trace API

Represents the trace namespace with its methods.

Reference

  • SAP Help

https://help.sap.com/doc/3de842783af24336b6305a3c0223a369/2.0.03/en-US/$.trace.html

  • Module

https://github.com/SAP/xsk/tree/main/modules/api/api-xsjs/src/main/resources/META-INF/dirigible/xsk/trace

  • Sample usage:
let trace = $.trace;
let response = require('http/v4/response');

// Check trace methods availability in the "Preview" tab
response.println("Debug logging enabled: " +trace.isDebugEnabled());
response.println("Error logging enabled: " +trace.isErrorEnabled());
response.println("Fatal logging enabled: " +trace.isFatalEnabled());
response.println("Info logging enabled: " +trace.isInfoEnabled());
response.println("Warning logging enabled: " +trace.isWarningEnabled());

// If the trace method is enabled, it will print the message in the "Console" tab
trace.debug("Debug message!");
trace.error("Error message!");
trace.error("Fatal message!");
trace.info("Info message!");
trace.warning("Warning message!");
  • Environment variables
Name Description Default value
XSK_LOG_DEBUG_ENABLED Enables debug level logging. true
XSK_LOG_ERROR_ENABLED Enables error level logging. true
XSK_LOG_FATAL_ENABLED Enables fatal level logging. true
XSK_LOG_INFO_ENABLED Enables log level logging. true
XSK_LOG_WARNING_ENABLED Enables warning level logging. true
  • Coverage
Methods Description Status
debug(message) Writes the given message with the trace-level debug to the application trace file.
error(message) Writes the given message with the trace-level error to the application trace file.
fatal(message) Writes the given message with the trace-level fatal to the application trace file.
info(message) Writes the given message with the trace-level info to the application trace file.
warning(message) Writes the given message with the trace-level warning to the application trace file.
isDebugEnabled() Returns true or false to show whether or not the tracer writes an entry in the application trace file for the trace-level debug.
isErrorEnabled() Returns true or false to show whether or not the tracer writes an entry in the application trace file for the trace-level error.
isFatalEnabled() Returns true or false to show whether or not the tracer writes an entry in the application trace file for the trace-level fatal.
isInfoEnabled() Returns true or false to show whether or not the tracer writes an entry in the application trace file for the trace-level info.
isWarningEnabled() Returns true or false to show whether or not the tracer writes an entry in the application trace file for the trace-level warning.
  • Issues

https://github.com/SAP/xsk/issues/17

  • Unit Tests

https://github.com/SAP/xsk/tree/main/modules/engines/engine-xsjs/src/test/resources/test/xsk/trace/trace.xsjs

  • Integration Tests ❌

Wiki icons legend

✅ - Feature implemented and working as supposed.
⚠️ - Feature partially implemented and needs to be finished.
❌ - Feature not implemented yet.

⚠️ **GitHub.com Fallback** ⚠️