Printing To Console

I am sure that this a repeat but I cannot find an answer to my question. I use Chrome and show Developer Tools Console and system.perspective.print will print to that console. I would like to print to that console from a script. system.perspective is not an option.

I tried system.uitl.logger but I cannot get that to print anywhere.

In perspective the logger from system.util.getLogger is going to the gateway logs.

I am not getting anything there either.

Show your code. Show where your code is called from.

1 Like

Hopefully this makes sense.

Tried info and trace for logger and nothing showed up in gateway logs.
Also perspective.print is not an option here.
Screenshot 2024-07-31 093227
Screenshot 2024-07-31 093311

I can use perspective.print here

I really just want to be able to print to the Chrome Console from the project library.

Add to the script:

import system.perspective

Then you can system.perspective.print() so long as the script is invoked from an action on the view.

EDIT: Actually I don't think the import is even necessary, so long as the script is invoked from the view. Invoking from the view is the only way you're going to get access to the browser console.

1 Like

Perfect. Thank you. When it didn't "intellisense" I assumed it wasn't available.

If you're in a new-ish version you can change the hint scope in the project library; there's a small drop down in the top right corner.

3 Likes