Skip to Content
Menú
This question has been flagged
2 Respostes
5504 Vistes

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

Avatar
Descartar
Best Answer

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)

Avatar
Descartar
Autor Best Answer

Hi Marcelo,

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de febr. 23
2399
0
de maig 22
2230
1
de juny 23
4590
1
de nov. 22
7280
1
de juny 25
1667