Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log messages sometimes do not appear #437

Open
fumoboy007 opened this issue Sep 9, 2024 · 3 comments · May be fixed by #438
Open

Log messages sometimes do not appear #437

fumoboy007 opened this issue Sep 9, 2024 · 3 comments · May be fixed by #438

Comments

@fumoboy007
Copy link

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
Copy link
Collaborator

@fumoboy007 which code?

fumoboy007 added a commit to fumoboy007/metaflow-service that referenced this issue Sep 9, 2024
The code uses `print` to log messages, so disable buffering to output the messages as soon as they are written.

Fixes Netflix#437.
@fumoboy007
Copy link
Author

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

@saikonen
Copy link
Collaborator

saikonen commented Oct 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants