Filter on Debug Only in Visual Studio Code

Author: Bruce Tollefson Published: June 10, 2022; Modified: June 10, 2022

When trying to debug within Developer Console you have the ability to filter the log to just show the debug statements that were placed in the code. This can be very helpful when trying to quickly diagnose why an error is occurring and is something used regularly.

debug console debug only

Unfortunately when trying to read a log in Visual Studio Code there isn’t a magic button that filters just to just the debug statements placed in the code. However if you open the log file in Visual Studio Code you can use the Find and Replace widget to get a similar effect. If you find ‘USER_DEBUG’ then click the ‘Open in Editor’ you will be able to view the debug statement along with the above and below line.

Visual Studio Code debug filter

Although it is not the same as the developer console debug filter. This method is closer to being able to filter on only debug statements in Visual Studio Code.

Leave a Reply

Your email address will not be published. Required fields are marked *