Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the VSCode error logs for extensions?

When I get an extension error I have no way of knowing why the error happens.

like image 444
Gyuri Avatar asked May 25 '17 19:05

Gyuri


People also ask

How do I get the error log in VS Code?

Now, in order to get the error log message, we use the following code: console. error("This is error message");

Where are VS Code logs stored?

For the VSCode logs, you can use the Developer: Open Logs Folder command, and for VSCode extensions it's Developer: Open Extensions Logs Folder . You can search for those commands in the Command Palette in the usual way.

How do I debug a VS Code extension?

You can easily run your extension under the debugger by pressing F5 . This opens a new VS Code window with your extension loaded. Output from your extension shows up in the Debug Console . You can set break points, step through your code, and inspect variables either in the Debug view or the Debug Console .

Why are my extensions not working in VS Code?

Views and more Actions click Disable All Installed Extensions then Enable All Extensions . Restart VSCode and it should be done; -) You can make sure again that the extensions are enabled.. Good Luck ! Best regards !


2 Answers

You're probably looking for:

cmd-shift-p -> Search Show Logs -> Extension Host

like image 160
Benno Straub Avatar answered Oct 16 '22 14:10

Benno Straub


From what I know there are no dedicated logs for extensions. When you are debugging your extension you can write notes to the console. However, when you have problems with an installed extension this won't help. But keep in mind vscode is kinda "web browser", so it has the usual browser developer tools (see Help -> Developer Tools),

enter image description here

which will show you runtime errors (and all the other stuff those tools allow usually, including the entire vscode DOM). That's probably the best option you have in such a scenario.

enter image description here

And for extensions that use previewHTML (or web views) there's a similar goodie, but tailored towards HTML development. Use ctrl/cmd+shift+P to open the command pallet and type "Webview Tools". Select the match to open a similar view like the one described in the first paragraph. But this one is only for the previewHTML content and allows you to debug that! This view is only available when a page containing a web view/previewHTML is active and closes automatically when the web view tab is closed.

like image 39
Mike Lischke Avatar answered Oct 16 '22 15:10

Mike Lischke