Use print to War Room, logs, and the IDE debugging resources to understand unexpected code behavior.
During the development phase of integrations and scripts, debugging allows you to understand what is happening behind the scenes when your code exhibits unexpected behavior. There are a few strategies that you can implement to debug code in Cortex XSIAM, described in the following sections.
Printing to the War Room
Seeing your statements in print is often useful when diagnosing issues. To do this, add the following to your integration/script code:
error_msg = "Here's your completely broken code" demisto.log(error_msg)
This prints the statements in the War Room, for you to review. Remove the error messages when you are done debugging, so that they do not appear in the final code.
Debugging using the IDE
Sometimes debugging via printing or using the logs is not sufficient. In that case you might want to use the debugger and go through the code line by line or breakpoint by breakpoint. See Debugging configurations for Python Apps in Visual Studio Code.
Note
We recommend using the Visual Studio Code extension when you are developing content.