In a Foundry Code Repository, how do I log debug messages from within a Python transform?

446 Views Asked by At

Is there any way to introduce debugging statements in your Transforms code, so you can later see them in driver logs, for example? Or is raising exceptions the only way to do this?

1

There are 1 best solutions below

1
On BEST ANSWER

Yes this is possible as of transforms-python 1.9.0 driver logs get written to the transaction. You can use python logging to write logs. For example:

import logging
log = logging.getLogger(__name__)

def my_transform(input):
    log.info("Testing logging")
    return input