[英]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?有没有什么办法可以在你的 Transforms 代码中引入调试语句,以便你以后可以在驱动程序日志中看到它们,例如? 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.是的,从 transforms-python 1.9.0 驱动程序日志写入事务开始,这是可能的。 You can use python logging to write logs.
您可以使用python logging来编写日志。 For example:
例如:
import logging
log = logging.getLogger(__name__)
def my_transform(input):
log.info("Testing logging")
return input
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.