在print()由Docker Compose管理的Docker容器中运行的Python应用程序中使用语句时,仅sys.stderr记录输出。print()没有看到Vanilla 语句,因此:
print("Hello? Anyone there?")
Run Code Online (Sandbox Code Playgroud)
...永远不会出现在常规日志中:
(您可以在我的应用中看到其他库显式打印的其他日志,但没有我自己的调用。)
如何避免我的print()电话被忽略?