Netflix / metaflow-service

:rocket: Metadata tracking and UI service for Metaflow!
http://www.metaflow.org
Apache License 2.0
191 stars 71 forks source link

Log messages sometimes do not appear #437

Open fumoboy007 opened 1 month ago

fumoboy007 commented 1 month ago

The code uses Python’s print function to log messages. However, print is buffered by default, so messages may not appear immediately or at all.

savingoyal commented 1 month ago

@fumoboy007 which code?

fumoboy007 commented 1 month ago

@savingoyal All code in this repository. Fixed in #438.

saikonen commented 6 days ago

I think the existing print statements might be leftovers from way back. The preferred way to fix this issue should probably be to utilize the preconfigured logger from services.utils wherever possible.

from services.utils import logging

logger = logging.getLogger("ComponentName")
...

logger.info("some important message")

some of the subprocess prints for the cache explicitly flush though so they should not be affected by the issue.