Skip to content

Honor an explicit --loglevel info when INFO is already the level - #7960

Open
zeyadrabie wants to merge 1 commit into
reflex-dev:mainfrom
zeyadrabie:honour-explicit-loglevel
Open

zeyadrabie wants to merge 1 commit into
reflex-dev:mainfrom
zeyadrabie:honour-explicit-loglevel

Conversation

@zeyadrabie

@zeyadrabie zeyadrabie commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Part of #7850 (the --loglevel half; #7947 handles export()).

set_log_level() only writes REFLEX_LOGLEVEL when the level changes, and it starts at INFO, so an explicit --loglevel info never reached the config and could be overridden by rxconfig.py or export_for_deploy().

This updates both --loglevel callbacks to write an explicit level to REFLEX_LOGLEVEL and adds unit tests. set_log_level() is left unchanged since hosting commands call it with a default "info" even without a flag, which would otherwise override rxconfig.py.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

View guided diff

set_log_level() only writes REFLEX_LOGLEVEL when the level changes, so
--loglevel info never reached the config. Both --loglevel callbacks now
write an explicit level to REFLEX_LOGLEVEL.
@zeyadrabie
zeyadrabie requested a review from a team as a code owner November 21, 2026 23:34
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Both CLI callbacks now write an explicit --loglevel value to REFLEX_LOGLEVEL, even when the current level already matches.

  • Explicit log levels reach app config even when they match the current level.

Reviews (1) · Last reviewed commit: "Honor an explicit --loglevel info when I..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="news/+explicit-loglevel-info.bugfix.md">

<violation number="1" location="news/+explicit-loglevel-info.bugfix.md:1">
P3: The root-package release rule requires a `performance` fragment for this production-code change, but this fragment is categorized as `bugfix`. Add the required `.performance.md` fragment or apply the documented `skip-changelog` waiver.

(Based on your team's feedback about root-package news fragments.)</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@@ -0,0 +1 @@
An explicit `--loglevel info` is no longer ignored when INFO is already the current level. Like any other `--loglevel` value, it now reaches `REFLEX_LOGLEVEL` and overrides a `loglevel` set in `rxconfig.py`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: The root-package release rule requires a performance fragment for this production-code change, but this fragment is categorized as bugfix. Add the required .performance.md fragment or apply the documented skip-changelog waiver.

(Based on your team's feedback about root-package news fragments.)

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At news/+explicit-loglevel-info.bugfix.md, line 1:

<comment>The root-package release rule requires a `performance` fragment for this production-code change, but this fragment is categorized as `bugfix`. Add the required `.performance.md` fragment or apply the documented `skip-changelog` waiver.

(Based on your team's feedback about root-package news fragments.) </comment>

<file context>
@@ -0,0 +1 @@
+An explicit `--loglevel info` is no longer ignored when INFO is already the current level. Like any other `--loglevel` value, it now reaches `REFLEX_LOGLEVEL` and overrides a `loglevel` set in `rxconfig.py`.
</file context>

@codspeed

codspeed Bot commented Nov 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 22 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 146 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing zeyadrabie:honour-explicit-loglevel (028ce99) with main (df7f157)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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 this pull request may close these issues.

1 participant