Print from Python policy

I find that the print statements from the Python callout policies are not working. Is it the default

 print "something" 

or is there a different way to print on edge ?

1 2 863
2 REPLIES 2

Not applicable

You can't.

See official docs note:

"System calls, for example network I/O, filesystem read/writes, current user info, process list, and CPU/memory utilization are not permitted by the security model. Although some such calls may be functional, they are unsupported and liable to be actively disabled at any time. For forward compatibility, you should avoid making such calls in your Python scripts."

http://docs.apigee.com/api-services/reference/python-script-policy

Create a variable and use message-logging-policy:

http://docs.apigee.com/api-services/reference/message-logging-policy

When you read/write a variable, it will appear in trace. Try...

username = flow.setVariable("MY_DEBUG_VARIABLE", "something");

...and see if it appears when you click on the Python callout in an active trace session.

This is only useful during development. As @Maudrit said, if you need this for all requests, use the Message Logging Policy.