When I use console.log(“Some text output”) in javascript in Visual Studio 2012 for Windows 8 metro programming where is the text being sent to? Where can I view it? I’ve got the “Output” panel up but I do not see the log text.
Am I not using the right function? Is there another function I must use to print to Output?
To actually see the JavaScript console select
DEBUG > Windows > JavaScript Consolein the Visual Studio menus. Then you can use the good oldconsole.log()to write to it, but you can also use the relatedWinJSfunctions:There is
WinJS.log()to log something after creating the function withWinJS.Utilities.startLog():Here’s some additional information on the
WinJSlogging functions:The
optionsobject must contain atypewhich is supposed to be one oferror,warn,infoorperf. Unless you want to capture all log entries, also addtagsto the object containing a space-separated list of tags you want to be logged.WinJS.log(message, tags, type): This function does not exist by default. However, it is created by yourstartLog()call. You could also create it manually but since you want logging to the console usingstartLog()is the way to go.