Node.js Debug Flags

Find and share HowTos to various installations / configurations!
Search

Post Reply
6 posts • Page 1 of 1
jimtaylor
Posts: 32
Joined: Tue Jun 11, 2013 10:18 am

Node.js Debug Flags

Post by jimtaylor »

Is the Node.js manager compatible with activating/deactivating debug flags from the WinCC OA Console?
If so, what is the method for accessing the debug flag(s) status within the JS code?
I tried to search for this within the documentation but could not find anything.
Thank you!

User avatar
kilianvp
Posts: 443
Joined: Fri Jan 16, 2015 10:29 am

Re: Node.js Debug Flags

Post by kilianvp »

You can't use the debug flags inside your javascript code

jimtaylor
Posts: 32
Joined: Tue Jun 11, 2013 10:18 am

Re: Node.js Debug Flags

Post by jimtaylor »

Thanks - that explains why I couldn't find it in the documentation!
I think this would be a useful feature, otherwise the WinCC OA log quickly fills up with console.info() entries which are very useful when debugging, but not wanted in production.

User avatar
hpuchegger
Posts: 86
Joined: Fri Oct 08, 2021 10:38 am

Re: Node.js Debug Flags

Post by hpuchegger »

There is a function which writes log entries if debug flag is activated - void logDebugF(flag: number | string, ...args: unknown[]) .

It is not documented though.

This is an example on how to use it:
const note = 'Additional note.';
winccoa.logDebugF('DebugFlag', 'Debug message', note);

Also there is a function isDbgFlag():
console.info(winccoa.isDbgFlag('REDU'));

Maybe you can check if this is what you're searching for.

Br, Herbert

jimtaylor
Posts: 32
Joined: Tue Jun 11, 2013 10:18 am

Re: Node.js Debug Flags

Post by jimtaylor »

Hi Herbert,
That's exactly what I'm looking for!
Unfortunately, neither of those functions work for me (I'm using 3.20 patch 3)

node (2), 2025.01.23 17:15:39.721, SYS, SEVERE, 0/javascript, TypeError: winccoa.logDebugF is not a function
node (2), 2025.01.23 17:19:13.539, SYS, SEVERE, 0/javascript, TypeError: winccoa.isDbgFlag is not a function

Maybe they are scheduled for a future release?
Jim

User avatar
hpuchegger
Posts: 86
Joined: Fri Oct 08, 2021 10:38 am

Re: Node.js Debug Flags

Post by hpuchegger »

You were right, the feature will only be released with the next patch 3.20.4 with the new NodeJS based WebUI backend.

Please test it again after the new patch was released.

Br, Herbert

Post Reply
6 posts • Page 1 of 1