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

[BUG] [flytekit] Use of root logger should be removed #2163

Closed
2 tasks done
wild-endeavor opened this issue Feb 14, 2022 · 0 comments
Closed
2 tasks done

[BUG] [flytekit] Use of root logger should be removed #2163

wild-endeavor opened this issue Feb 14, 2022 · 0 comments
Assignees
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@wild-endeavor
Copy link
Contributor

wild-endeavor commented Feb 14, 2022

Describe the bug

Please see the slack thread starting at https://flyte-org.slack.com/archives/CNMKCU6FR/p1644863543937919?thread_ts=1641829439.010500&cid=CNMKCU6FR

Basically, because flytekit still uses the root logger in some places (like when you just import logging and then use logging.info), users' basicConfig command isn't working.

In [1]: import logging

In [2]: logging.info("fdjs")

In [3]: logging.basicConfig(level=logging.INFO)

In [4]: logging.root.__dict__
Out[4]:
{'filters': [],
 'name': 'root',
 'level': 30,  # Should be 20.
 'parent': None,
 'propagate': True,
 'handlers': [<StreamHandler <stderr> (NOTSET)>],
 'disabled': False,
 '_cache': {20: False}}

This is because there's logic in basicConfig that will effectively silently fail if any logging call to logging has been made.

The fix is to only use loggers under flytekit.loggers, which is something we should do anyways.

Expected behavior

see above.

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@wild-endeavor wild-endeavor added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers flytekit FlyteKit Python related issue labels Feb 14, 2022
@wild-endeavor wild-endeavor added this to the 1.0.0 - Phoenix! milestone Feb 16, 2022
@EngHabu EngHabu removed the untriaged This issues has not yet been looked at by the Maintainers label Feb 23, 2022
@pingsutw pingsutw self-assigned this Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
None yet
Development

No branches or pull requests

3 participants