Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
5485 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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)

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Hi Marcelo,

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 23
2389
0
maj 22
2215
1
cze 23
4572
1
lis 22
7259
1
cze 25
1609