Skip to content

Add logger.hideWelcomeMessage config option#14118

Merged
vdonato merged 1 commit intodevelopfrom
vdonato/logger-hideWelcomeMessage
Feb 25, 2026
Merged

Add logger.hideWelcomeMessage config option#14118
vdonato merged 1 commit intodevelopfrom
vdonato/logger-hideWelcomeMessage

Conversation

@vdonato
Copy link
Copy Markdown
Collaborator

@vdonato vdonato commented Feb 24, 2026

Describe your changes

Add a new hidden config option that suppresses the welcome message
printed when starting a Streamlit server. This is useful in hosted
environments (like SiS) where the default messages show URLs and
external IP warnings that are misleading or inactionable (for example,
from the container's perspective, it may think that it's serving the app at
localhost, but we don't want to display that to the user).

When enabled, the "Welcome to Streamlit" / "You can now view your
Streamlit app" message along with Local URL, Network URL, and
External URL information will not be printed.

We also tweak the grammar in some other logs in
lib/streamlit/connections/snowflake_connection.py, which is technically an
orthogonal change but probably not worth creating a second PR for.

Testing Plan

  • Unit Tests (JS and/or Python)
    • Added a unit test
  • Any manual testing needed?
    • Ran streamlit hello with the new config option set and verified that the
      welcome message doesn't appear.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Feb 24, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 24, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-14118/streamlit-1.54.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-14118.streamlit.app (☁️ Deploy here if not accessible)

@vdonato vdonato added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Feb 24, 2026
@vdonato vdonato marked this pull request as ready for review February 24, 2026 23:06
Copilot AI review requested due to automatic review settings February 24, 2026 23:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new hidden configuration option to suppress the startup “welcome / URLs” output printed by streamlit run, which is particularly useful in hosted/container environments where the default localhost/network URLs can be misleading.

Changes:

  • Introduce hidden config option logger.hideWelcomeMessage (default False).
  • Skip all _print_url(...) CLI output in bootstrap.py when the option is enabled.
  • Minor grammar tweak to two Snowflake connection log messages.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lib/streamlit/config.py Defines the new hidden config option logger.hideWelcomeMessage.
lib/streamlit/web/bootstrap.py Early-return in _print_url when the option is enabled, suppressing the welcome/URL block.
lib/tests/streamlit/web/bootstrap_test.py Adds a unit test verifying _print_url produces no output when the option is enabled.
lib/streamlit/connections/snowflake_connection.py Updates two INFO log strings for improved grammar (“Connect…” → “Connecting…”).

@vdonato vdonato force-pushed the vdonato/logger-hideWelcomeMessage branch from 9b79f8a to f45a30d Compare February 24, 2026 23:13
@sfc-gh-bnisco sfc-gh-bnisco added the ai-review If applied to PR or issue will run AI review workflow label Feb 24, 2026
@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Consolidated Code Review

Summary

This PR adds a new hidden config option logger.hideWelcomeMessage that suppresses the welcome/URL terminal output when starting a Streamlit server. When set to True, the "Welcome to Streamlit" / "You can now view your Streamlit app" output (including Local URL, Network URL, and External URL) is suppressed. This is intended for hosted environments (e.g. Streamlit in Snowflake) where the default localhost URL messages are misleading.

Additionally, a minor grammar fix changes "Connect to Snowflake..." to "Connecting to Snowflake..." in two log messages in snowflake_connection.py.

Files changed:

  • lib/streamlit/config.py — new hidden config option
  • lib/streamlit/web/bootstrap.py — early-return guard in _print_url()
  • lib/streamlit/connections/snowflake_connection.py — log message wording fix
  • lib/tests/streamlit/config_test.py — config key registration
  • lib/tests/streamlit/web/bootstrap_test.py — new unit test

Reviewer Agreement

Both reviewers (gpt-5.3-codex-high and opus-4.6-thinking) agree on all major points:

  • Implementation quality: Clean, minimal, and follows existing patterns. The early-return in _print_url() is the simplest correct approach.
  • Config option: Correctly placed in the logger section, properly marked visibility="hidden", uses bool type with False default.
  • Backwards compatibility: No breaking changes. Default behavior is preserved.
  • Security: No concerns. The change only affects CLI output suppression.
  • Test coverage: Adequate for the scope. Existing tests implicitly cover the default (False) case.
  • Accessibility: Not applicable (backend-only changes).
  • Verdict: Both reviewers approved.

Reviewer Differences

Minor differences in optional recommendations only (no disagreements on substance):

Topic gpt-5.3-codex-high opus-4.6-thinking
Additional test suggestion Test _print_url(False) with config set to True Not needed — early return occurs before is_running_hello is read
Type annotation on test Not mentioned Noted missing -> None but acknowledged file conventions omit it

Resolution: Both suggestions are non-blocking nits. The opus-4.6-thinking observation that testing is_running_hello=False is redundant (since the early return precedes that branch) is correct. The type annotation nit is valid per lib/tests/AGENTS.md guidelines but consistent with the existing file style.

Code Quality

The implementation is clean and minimal:

  • lib/streamlit/config.py: The new config option is well-placed in the logger section, correctly marked as visibility="hidden", uses bool type with a False default, and has a clear description.
  • lib/streamlit/web/bootstrap.py: The early-return guard at the top of _print_url is the simplest correct approach, suppressing all output with a single check.
  • lib/streamlit/connections/snowflake_connection.py: The grammar fix ("Connect" -> "Connecting") is trivial and correct — present participle is more natural for in-progress log messages.

Test Coverage

  • lib/tests/streamlit/config_test.py validates the new config key is registered in the exhaustive key list.
  • lib/tests/streamlit/web/bootstrap_test.py adds test_print_url_hidden_when_config_set verifying stdout is empty when the config is enabled, using the idiomatic patch_config_options pattern.
  • Existing tests (test_print_hello_message, test_print_urls_configured) implicitly cover the default False path.
  • No E2E coverage was added, which is appropriate for a hidden, internal config option.

Backwards Compatibility

No breaking changes:

  • The config option defaults to False, preserving existing behavior.
  • The option has visibility="hidden", so it won't appear in user-facing config documentation or streamlit config show.
  • No public API surface is modified.

Security & Risk

No security concerns. Regression risk is minimal — a single early return gated by an explicit boolean config flag, with no side effects on network binding, auth, or request handling.

Accessibility

Not applicable — backend-only Python changes with no frontend or UI impact.

Recommendations

No blocking issues. One minor suggestion for consideration:

  1. Type annotation on test method: Consider adding -> None to test_print_url_hidden_when_config_set for consistency with the lib/tests/AGENTS.md guideline about fully annotated new tests (though existing methods in the file omit annotations).

Verdict

APPROVED: Both reviewers approved. The implementation is clean, well-scoped, backward compatible, and adequately tested. No critical or blocking issues were raised by any reviewer.


Consolidated review by opus-4.6-thinking. Individual reviews below.


📋 Review by `gpt-5.3-codex-high`

Summary

This PR adds a hidden config option, logger.hideWelcomeMessage, to suppress startup welcome/URL terminal output, and wires it into bootstrap._print_url(). It also includes a targeted unit test for the new suppression behavior and a small wording cleanup in Snowflake connection log messages.

Code Quality

The changes are small, focused, and follow existing patterns in the config and bootstrap modules.
No code quality issues were identified in the modified files:

  • lib/streamlit/config.py
  • lib/streamlit/web/bootstrap.py
  • lib/streamlit/connections/snowflake_connection.py
  • lib/tests/streamlit/config_test.py
  • lib/tests/streamlit/web/bootstrap_test.py

Test Coverage

Coverage for the new behavior is good for a scoped config addition:

  • lib/tests/streamlit/config_test.py validates the new config key is registered.
  • lib/tests/streamlit/web/bootstrap_test.py adds a regression test that verifies _print_url() emits no output when logger.hideWelcomeMessage=True.

No e2e coverage was added, which is acceptable for this internal, hidden config path; residual risk is low and mostly limited to startup logging behavior.

Backwards Compatibility

No breaking changes detected.

  • The new option is hidden and defaults to False, so existing behavior is unchanged unless explicitly enabled.
  • Existing startup output remains intact for all current users by default.
  • The Snowflake logging text changes are message-only and do not affect behavior or API contracts.

Security & Risk

No security concerns identified.

Regression risk appears low:

  • The functional change is a single early return in _print_url() gated by an explicit config flag.
  • The option does not alter network binding, auth, or request handling behavior.

Accessibility

No frontend/UI changes in this PR; accessibility impact is not applicable.

Recommendations

  1. Optional: add one additional unit assertion for the non-hello path (_print_url(False)) with logger.hideWelcomeMessage=True to make intent explicit across both title branches.

Verdict

APPROVED: The implementation is focused, backward compatible, and adequately tested for the new hidden config behavior.


This is an automated AI review by gpt-5.3-codex-high. Please verify the feedback and use your judgment.

📋 Review by `opus-4.6-thinking`

Summary

This PR adds a new hidden config option logger.hideWelcomeMessage that suppresses the welcome/URL message printed when starting a Streamlit server. When set to True, the "Welcome to Streamlit" / "You can now view your Streamlit app" output (including Local URL, Network URL, and External URL) is suppressed. This is intended for hosted environments (e.g. Streamlit in Snowflake) where the default messages showing localhost URLs are misleading.

Additionally, a minor grammar fix changes "Connect to Snowflake..." to "Connecting to Snowflake..." in two log messages in snowflake_connection.py.

Code Quality

The implementation is clean and minimal:

  • lib/streamlit/config.py (lines 550-564): The new config option is well-placed in the logger section, correctly marked as visibility="hidden", uses bool type with a False default, and has a clear description. The placement follows alphabetical order within the section.

  • lib/streamlit/web/bootstrap.py (lines 236-237): The early-return guard at the top of _print_url is the simplest correct approach. It prevents all output — title message, URLs, and the hello footer — with a single check.

  • lib/streamlit/connections/snowflake_connection.py (lines 643, 652): The grammar fix ("Connect" -> "Connecting") is trivial and correct. Using the present participle is more natural for a log message emitted while an action is in progress.

No issues with code structure or patterns.

Test Coverage

  • lib/tests/streamlit/config_test.py (line 769): The new option is correctly added to the exhaustive config key list in alphabetical order.

  • lib/tests/streamlit/web/bootstrap_test.py (lines 66-72): The new test test_print_url_hidden_when_config_set verifies that stdout is empty when the config is enabled. The test uses patch_config_options which is idiomatic for the project. The test has a descriptive docstring, consistent with project guidelines.

Minor observations:

  • The test only exercises is_running_hello=True, but since the early return occurs before that parameter is read, testing both values would be redundant.
  • The test method lacks a -> None return type annotation (per lib/tests/AGENTS.md: "New tests should be fully annotated with types"), but all existing methods in this unittest class also omit annotations, so this is consistent with the file's conventions.
  • There is no negative test verifying that the welcome message still prints when logger.hideWelcomeMessage is False (the default). However, the existing test_print_hello_message and test_print_urls_configured tests already exercise _print_url without this config set (defaulting to False) and assert output is produced, which implicitly covers this.

Overall, test coverage is adequate for the scope of this change.

Backwards Compatibility

No breaking changes:

  • The config option defaults to False, so existing behavior is unchanged.
  • The option has visibility="hidden", so it does not appear in user-facing config documentation or streamlit config show.
  • No public API surface is modified.
  • The Snowflake log message wording change is internal and has no user-facing impact.

Security & Risk

No security concerns identified:

  • The change only affects CLI output suppression; no authentication, network, or data-handling logic is modified.
  • The config option is hidden and boolean-only, with no injection surface.
  • Risk of regression is minimal — the guard is a simple early return with no side effects.

Accessibility

Not applicable — this PR modifies only backend Python code (CLI output and config). No frontend or UI changes are involved.

Recommendations

No blocking issues. Minor suggestions for consideration:

  1. Type annotation on test method: Consider adding -> None to test_print_url_hidden_when_config_set for consistency with the lib/tests/AGENTS.md guideline about fully annotated new tests. This is a nit given the existing file conventions.

Verdict

APPROVED: Clean, well-scoped addition of a hidden config option to suppress the welcome message in hosted environments. Implementation is correct, tests are adequate, and there are no backwards compatibility or security concerns.


This is an automated AI review by opus-4.6-thinking.

@vdonato vdonato merged commit be831de into develop Feb 25, 2026
55 checks passed
@vdonato vdonato deleted the vdonato/logger-hideWelcomeMessage branch February 25, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants