console.log() shows nothing in log viewer

Find and share HowTos to various installations / configurations!
Search

Post Reply
6 posts • Page 1 of 1
anes47
Posts: 10
Joined: Mon Apr 08, 2019 10:58 am

console.log() shows nothing in log viewer

Post by anes47 »

Hello,

I've a script and I use loadSnippet to load it (I use OaJsApi), the problem is I don't know how to debug in WebViewer EWO, in Chrome I can call the console but how I can call it in Wincc OA (I can't debug with chrome because I use OaJsApi so I must call it from CTRL with this.loadSnippet("url")).

I tried also to print messages from JS in log Viewer using console.log(), but nothing happens in log viewer.

Any ideas ?

Best Regards

Anes

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: console.log() shows nothing in log viewer

Post by leoknipp »

I'm not sure which log viewer you are talking about.
The WinCC OA log viewer shows information for *.log files which are written in the log directory of the WinCC OA project.

Best Regards
Leopold Knipp
Senior Support Specialist

anes47
Posts: 10
Joined: Mon Apr 08, 2019 10:58 am

Re: console.log() shows nothing in log viewer

Post by anes47 »

the Log Viewer of project, it doesn't print messages written inside JavaScript code using console.log().

Best Regards

Anes

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: console.log() shows nothing in log viewer

Post by leoknipp »

If there is no ".log" file existing which has the JavaScript information the log viewer cannot show the information.
When information shall be displayed in the log viewer you have to write the information to a ".log" file in the log directory for the WinCC OA project.

Best Regards
Leopold Knipp
Senior Support Specialist

anes47
Posts: 10
Joined: Mon Apr 08, 2019 10:58 am

Re: console.log() shows nothing in log viewer

Post by anes47 »

Okay, Thank you.

can you show me please what should I add inside .log file to have a console "like chrome's console", where I can see errors, messages .. etc

Thank you so much

Anes

philipp.wechsler
Posts: 13
Joined: Tue May 17, 2016 2:27 pm

Re: console.log() shows nothing in log viewer

Post by philipp.wechsler »

At WebView Ewo you can activate the developer settings with:

Code: Select all

this.setAttribute ("DeveloperExtrasEnabled", TRUE);
Then, you have a new context menu entry "Inspect" on the running WebView Ewo.
It opens the "Web Inspector" that have a console like Google Chrome.

Post Reply
6 posts • Page 1 of 1