Advanced debugging in the Dev Console

Hi Guys

I am new to using the developer Console to debug my app code.

Can you please share some basics / pro tips about what I can do and how I would go about doing it?

For example how do I inspect variables, can I execute functions and can I use break points?

@forumfred great question!

When you have the debug console enabled (JourneyScript.worker.js) you have access to the following:

  1. Variables on the current view: view.myvar
  2. Call functions defined on the current view: viewController.init()
  3. Query the database: await DB.user.first()
  4. The current user object: user
  5. Query and function execution details: journey.profiling.enable()
    • Enable the “Verbose” log level in the console for this

In TypeScript apps, you can additionally set breakpoints:

  • You can include a debugger; statement in your app’s TS code, and this should pause execution when the debugger statement is reached if the debug console is open at the time.
  • You can also access your app’s source files in the “Source” tab under the JourneyScript.worker.js section and then set breakpoints:
    • Or use the Open File command (⌘+P) to open a file

  • Another option is to set the “Pause on (un)caught exceptions” setting, which will open the debugger if the debug console is open.

Screenshot 2023-08-28 at 2.18.16 PM

Is there a way to filter out some of the internal noise on the console.
If I put some console.logs into my source, they can get missed quite easily amongst all the normal logging.
Any strategy to help my debugging statements stand out?

@jaymer Use ‘Default’ levels, not All (ie don’t include verbose logs) and clear the console before running the code for which you want to see the logs.