Currently from within Script transform, it's not possible to write logs and metrics. Providing a context object that would allow one to programmatically write log and metric would be very useful to developer building it.
Added Logging and Metrics support for Script, ScriptFilter and Validator Transforms