Created by: liym27
PR types
Others
PR changes
Others
Describe
sys.stdout
1. New features: also output log or code to - Add parameter
also_to_stdout
for APIpaddle.jit.set_verbosity
to control whether to also output log messages tosys.stdout
. - Add parameter
also_to_stdout
for APIpaddle.jit.set_code_level
to control whether to also output code tosys.stdout
.
2. Optimize log messages in dygraph-to-static
- Add logger_name
Dynamic-to-Static
in logger format so that logs about Dynamic-to-Static can be distinguished from other logs- Before:
After:2020-09-15 11:13:18,909 WARNING: warn message ...
2020-09-15 11:13:18,909 Dynamic-to-Static WARNING: warn message ...
- Optimization on other details
logging_utils
to make the log more standardized
3. In dygraph-to-static, use log function from Use logging_utils.warn
to replace other warn function like logging.warning
, _logger.warning
and warnings.warn
in dygraph_to_static
优化 log 展示效果,方便区分动转静和框架其他log
sys.stdout
1. 新特性:也可以输出 log 或 code 到 - API
paddle.jit.set_verbosity
增加参数also_to_stdout
控制是否也将日志信息输出到sys.stdout
- API
paddle.jit.set_code_level
增加参数also_to_stdout
控制是否也将code信息输出到sys.stdout
2. 优化动转静中的 log 信息
- log 格式中,增加 logger 名称
Dynamic-to-Static
,使得动转静 log 与框架其他 log 区分开- Before:
After:2020-09-15 11:13:18,909 WARNING: warn message ...
2020-09-15 11:13:18,909 Dynamic-to-Static WARNING: warn message ...
- 优化了 log 信息的一些其他细节
logging_utils
中的接口,以规范化动转静 log (动转静log 会统一 Dynamic-to-Static
标识,统一控制是否输出到 stdout)
3. 动转静的 log/warning等 统一使用 本PR修改:使用logging_utils.warn
替代了动转静相关文件中的 warn 函数 如 logging.warning
, _logger.warning
和 warnings.warn