简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM