问题描述
我正在配置Python logging in my Google Cloud function。
# Imports the Cloud Logging client library
import google.cloud.logging
# Instantiates a client
logclient = google.cloud.logging.Client()
# Imports Python logging module
import logging
# Retrieves a Cloud Logging handler based on the environment
# you're running in and integrates the handler with the
# Python logging module. By default this captures all logs
# at INFO level and higher
logclient.get_default_handler()
logclient.setup_logging(log_level=logging.INFO)
这是日志记录行:
logging.info(f'Creating invoice for {entity_id}')
此Google Cloud函数中没有其他带有该消息的日志记录行。
在Google Cloud Console中查看时,日志成功显示。
但是,它被写为两个条目,相同的时间戳记,但严重性不同:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)