#1027 feat: add user-facing logger as flyte.logger
Pull request opened by
AdilFayyaz
Motivation
Users couldn't see task logs because flyte.logger pointed to the internal SDK logger (WARNING default), silently dropping user log calls. The internal and user-facing loggers needed to be separated.
Summary
• Added user_logger in _logging.py ("flyte.user", INFO default, no [flyte] prefix) and exported it as flyte.logger
• Internal SDK logger stays private in _logging.py, imported directly via from flyte._logging import logger in SDK code
• Added --user-log-level CLI flag and USER_LOG_LEVEL env var to control user log level independently of -v
• Threaded user_log_level through init_from_config → init → _initialize_logger → initialize_logger so the CLI flag survives
re-initialization
Test Plan
•
uv run pytest tests/user_api/test_logging.py -v
• Manual verification with examples/basics/user_logging.py:
INFO visible, DEBUG suppressed
flyte run --local examples/basics/user_logging.py process --name hello --iterations 3
DEBUG visible
flyte --user-log-level debug run --local examples/basics/user_logging.py process --name hello --iterations 3
Structured JSON output
flyte --log-format json run --local examples/basics/user_logging.py process --name hello --iterations 3
flyteorg/flyte-sdk