Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
5480 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
feb 23
2387
0
mag 22
2210
1
giu 23
4571
1
nov 22
7257
1
giu 25
1602