I have a question about \"console.log\" in Javascript Web Office Addins. Currently I am working on Javascript Word Addin
When you say you're not using Visual Studio, do you mean that you're not using the Visual Studio template? Or that you physically don't have Visual Studio on the machine (if so, might I recommend you install it -- even just the free/community edition)?
Once you have that:
You should now get a full debugging experience, complete with console output ("JavaScript console" window; use the Quick Launch (ctrl-Q) to launch it if it doesn't display be default), DOM Explorer (again, use Quick Launch if you don't see it), and more.
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT
There is an alt way if you don't have Visual Studio. There is a tool in windows name is 'IEChooser (was F12Chooser)', you can find it at:
More info can be found at: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-f12-developer-tools-on-windows-10
To view the logs generated by office add-ins, you need to use the webservice of the application you are using e.g Excel, Outlook etc. All you need to do is to upload the manifest.xml file as an addin on the web and then it will automactically sync or update when you make changes to your local files.
In Mac you can use Safari Web Inspector as it is explained here:
https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-office-add-ins-on-ipad-and-mac
In Windows is possible to just attach a debugger to the add-in:
https://docs.microsoft.com/en-us/office/dev/add-ins/testing/attach-debugger-from-task-pane
I don't know if this option is available on free versions of Visual Studio, but with licensed VS 2015 I solved with a simple window:
(after starting the project) Debug > Windows > JavaScript Console
For anyone looking at this in 2020. There is a new Microsoft Edge Dev Tools (Preview) app for Windows 10. This tool will automatically detect both local processes. Simply click on the process and it will attach. You can then debug, check out the console, and more.
https://www.microsoft.com/en-us/p/microsoft-edge-devtools-preview/9mzbfrmz0mnj?activetab=pivot:overviewtab