我正在使用 #target_data = my_list[1]['2']
dict_1 = target_data['oscar'][0]
chemical_data = dict_1['chemicalData']
target_dict = {}
for item in chemical_data.items():
chemical_dict = item[1]
chemical_name = chemical_dict['name']
chemical_InChIKey = chemical_dict['standardInChIKey']
target_dict.update({chemical_name : chemical_InChIKey})
运行时部署Cloud Function。感谢this question,我知道我可以将Python本机记录器连接到Stackdriver记录器。所以我的Cloud Function看起来像这样:
python37
但是当我在Stackdriver中查看生成的日志时:
import logging
logging.basicConfig(format="%(module)s.%(funcName)s: %(message)s", level=logging.INFO)
from google.cloud import logging as glogging
glogging.Client().setup_logging()
def endpoint():
logging.info("this should be prefixed with main.endpoint")
return "ok"
严重性。似乎ERROR
中的某些内容仅在处理邮件而忽略其他所有内容。有没有办法将其传递给我定义的格式化程序?
为什么还要重复日志?
答案 0 :(得分:0)
当我在本地运行代码时,我得到了:
main.endpoint: this should be prefixed with main.endpoint
this should be prefixed with main.endpoint
Waiting up to 5 seconds.
Sent all pending logs.
因此,似乎该库正在复制日志。