From f10bb343a6fdd8b7684451cea346fba51b3fe3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20De=20la=20Torre=20Vico?= Date: Thu, 20 Jun 2024 09:11:01 +0200 Subject: [PATCH] doc(debugging): Improve actual VSCode debugging file (#4279) --- docs/developer-guide/debugging.md | 63 ++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/docs/developer-guide/debugging.md b/docs/developer-guide/debugging.md index e6b20d6075..33c0849f49 100644 --- a/docs/developer-guide/debugging.md +++ b/docs/developer-guide/debugging.md @@ -1,7 +1,11 @@ # Debugging Debugging in Prowler make things easier! -If you are developing Prowler, it's possible that you will encounter some situations where you have to inspect the code in depth to fix some unexpected issues during the execution. To do that, if you are using VSCode you can run the code using the integrated debugger. Please, refer to this [documentation](https://code.visualstudio.com/docs/editor/debugging) for guidance about the debugger in VSCode. +If you are developing Prowler, it's possible that you will encounter some situations where you have to inspect the code in depth to fix some unexpected issues during the execution. + +## VSCode + +In VSCode you can run the code using the integrated debugger. Please, refer to this [documentation](https://code.visualstudio.com/docs/editor/debugging) for guidance about the debugger in VSCode. The following file is an example of the [debugging configuration](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) file that you can add to [Virtual Studio Code](https://code.visualstudio.com/). This file should inside the *.vscode* folder and its name has to be *launch.json*: @@ -11,31 +15,62 @@ This file should inside the *.vscode* folder and its name has to be *launch.json "version": "0.2.0", "configurations": [ { - "name": "Python: Current File", - "type": "python", + "name": "Debug AWS Check", + "type": "debugpy", "request": "launch", "program": "prowler.py", "args": [ "aws", - "-f", - "eu-west-1", - "--service", - "cloudwatch", "--log-level", "ERROR", - "-p", - "dev", + "-c", + "" ], "console": "integratedTerminal", "justMyCode": false }, { - "name": "Python: Debug Tests", - "type": "python", + "name": "Debug Azure Check", + "type": "debugpy", "request": "launch", - "program": "${file}", - "purpose": [ - "debug-test" + "program": "prowler.py", + "args": [ + "azure", + "--sp-env-auth", + "--log-level", + "ERROR", + "-c", + "" + ], + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Debug GCP Check", + "type": "debugpy", + "request": "launch", + "program": "prowler.py", + "args": [ + "gcp", + "--log-level", + "ERROR", + "-c", + "" + ], + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Debug K8s Check", + "type": "debugpy", + "request": "launch", + "program": "prowler.py", + "args": [ + "kubernetes", + "--log-level", + "ERROR", + "-c", + "" ], "console": "integratedTerminal", "justMyCode": false