コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5482 ビュー

Hi,


I am working on setting up a development environment with Docker. When I use the print() method in a class method nothing gets actually printed anywhere (that I can find at least).


I've seen it work in videos on Youtube so I assume this si possible. Any clue how to make this work with a Docker setup?


Thanks!


Guillaume

アバター
破棄
最善の回答

Try to use the logger.
import logging

_logger = logging.getLogger(__name__)

and then in your code you can use:
_logger.info(YOUR_STRING_OR_VARIABLE)

アバター
破棄
著作者 最善の回答

Hi Marcelo,

Thanks a lot for your answer. This does work. I just thought it's a bit overkill to do a quick debugging.

アバター
破棄
関連投稿 返信 ビュー 活動
2
2月 23
2387
0
5月 22
2210
1
6月 23
4571
1
11月 22
7257
1
6月 25
1602