-
Notifications
You must be signed in to change notification settings - Fork 3
api trace
Ayhan Rashidov edited this page Sep 5, 2022
·
2 revisions
Represents the trace namespace with its methods.
Provides tracing functions that enable your application to write predefined messages in the form of application-specific trace output.
https://help.sap.com/doc/3de842783af24336b6305a3c0223a369/2.0.03/en-US/$.trace.html
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!");
Name | Description | Default value |
---|---|---|
KRONOS_LOG_DEBUG_ENABLED | Enables debug level logging. | true |
KRONOS_LOG_ERROR_ENABLED | Enables error level logging. | true |
KRONOS_LOG_FATAL_ENABLED | Enables fatal level logging. | true |
KRONOS_LOG_INFO_ENABLED | Enables log level logging. | true |
KRONOS_LOG_WARNING_ENABLED | Enables warning level logging. | true |
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. | ✅ |
✅ - Feature implemented and working as supposed.
❌ - Feature not implemented yet.