0

在 Google AI Platform 上,打印在 stderr 上的所有日志都被解释为 ERROR。有没有办法将日志打印为 INFO、WARNING 和 CRITICAL?

在此处输入图像描述

4

1 回答 1

0

查看用于训练日志的 AI Platform 故障排除文档。有说You can put logging events in your application with standard Python libraries,比如伐木

我还没有尝试过,但似乎您可以使用记录器对象类来设置所需的日志级别:

Logger.info(msg, *args, **kwargs)
Logs a message with level INFO on this logger. The arguments are interpreted as for debug().

Logger.warning(msg, *args, **kwargs)
Logs a message with level WARNING on this logger. The arguments are interpreted as for debug().

Logger.critical(msg, *args, **kwargs)
Logs a message with level CRITICAL on this logger. The arguments are interpreted as for debug().
于 2021-01-07T11:14:19.883 回答