It’s complicated
Starting from most local to least…
In the script console,
-
print
will log directly to the output buffer on the right hand side. -
system.util.getLogger()
will log to the named ‘Output Console’ Designer window.
Bonus: A script invoked from here using system.util.invokeAsync
will print
to the regular output console, not the buffer on the right hand side.
Anywhere else in the designer (except Perspective),
-
print
and -
system.util.getLogger
will log to the ‘Output Console’ (which is technically alsoSTDOUT
andSTDERR
for the designer process).
The same applies to a Vision client.
Anywhere in Perspective in the Designer, your script is actually being run on the gateway.
Therefore,
-
print
will go to thewrapper.log
of the gateway. -
system.util.getLogger()
will go to the log file of the gateway and thewrapper.log
. -
system.perspective.print
will log to the ‘Output Console’.
For extra confusion, we deliberately catch certain errors from scripting and forward them to the designer and don’t log them on the gateway, so sometimes errors from a design session will appear to be “designer local” when they’re really not.
In a script actually executing on the gateway (including gateway event scripts, tag event scripts, SFCs, alarm pipeline scripts, reporting scripts, and anything else I’m forgetting),
-
print
goes to the wrapper log -
system.util.getLogger
goes to the system logs and the wrapper log -
system.perspective.print
won’t work (unless you manually specify a Perspective session ID, at which point you probably already know what you’re doing )
In a script executing inside of a Perspective session,
-
print
goes to the wrapper log -
system.util.getLogger
goes to the system logs and the wrapper log -
system.perspective.print
has a ‘scope’ argument. If unspecified or set to ‘client’, output will be sent to the browser console wherever the session is running, and not logged to the gateway. If scope is set to ‘gateway’, then output is logged…to the gateway.
And I think that’s about all of the possibilities covered.