Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5489 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Get all logs from all forms แก้ไขแล้ว
2
ก.พ. 23
2390
0
พ.ค. 22
2216
1
มิ.ย. 23
4574
1
พ.ย. 22
7268
1
มิ.ย. 25
1612