Skip to content

ENG-10963 refactor(log): migrate reflex-base and component packages to logging (2/5) - #6864

Open
FarhanAliRaza wants to merge 2 commits into
mainfrom
farhan/eng-10963-log-2-migrate-base
Open

ENG-10963 refactor(log): migrate reflex-base and component packages to logging (2/5)#6864
FarhanAliRaza wants to merge 2 commits into
mainfrom
farhan/eng-10963-log-2-migrate-base

Conversation

@FarhanAliRaza

@FarhanAliRaza FarhanAliRaza commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Replaces console.debug/info/warn/error call sites with per-module logging.getLogger(__name__) loggers across reflex-base and the component packages (core, lucide, plotly, dataeditor, react-player). No behavior change beyond the new sink.

Stack (ENG-10963)

#6863 → this → #6865#6866#6867.
Merge in order; each PR is based on the previous branch.

@FarhanAliRaza
FarhanAliRaza requested a review from a team as a code owner August 10, 2026 20:36
@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

ENG-10963

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR migrates legacy console calls in reflex-base and several component packages to per-module standard-library loggers.

  • Adds managed logging initialization during configuration loading.
  • Preserves traceback logging in event-processing failure paths.
  • Updates sitemap and configuration tests to inspect captured log records.
  • Refreshes generated stub hashes and package news fragments.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/config.py Migrates configuration warnings and debug output to module logging and ensures managed worker logging is configured during Config initialization.
packages/reflex-base/src/reflex_base/event/processor/event_processor.py Replaces manually formatted tracebacks with logger.exception while retaining active exception context at each call site.
packages/reflex-base/src/reflex_base/plugins/sitemap.py Migrates skipped-route warnings to the sitemap module logger without changing sitemap generation behavior.
tests/units/plugins/test_sitemap.py Updates warning assertions to inspect only warning records emitted by the sitemap logger.
tests/units/test_config.py Updates plugin-warning tests to validate captured standard logging records.

Reviews (7): Last reviewed commit: "fix(log): review fixes for the reflex-ba..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Aug 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
🆕 1 new benchmark
⏩ 8 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation test_import_reflex N/A 4.9 ms N/A

Comparing farhan/eng-10963-log-2-migrate-base (ee282c1) with main (852ef91)2

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.

  2. No successful run was found on main (5194efc) during the generation of this report, so 852ef91 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 666df42e4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@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 28 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/reflex-components-plotly/src/reflex_components_plotly/plotly.py">

<violation number="1" location="packages/reflex-components-plotly/src/reflex_components_plotly/plotly.py:21">
P2: Since `reflex_components_plotly` can be installed and imported standalone (without `import reflex`), this warning is emitted via a module logger that may never get the Reflex logging handlers attached (those are only wired up through the Reflex config bootstrap). In that case the warning falls back to Python logging's default stderr handler, bypassing options like `REFLEX_LOG_JSON`/`REFLEX_ENABLE_FULL_LOGGING` and potentially polluting a JSON-structured log stream with a plain-text line. Consider ensuring the logging pipeline is configured (or lazily bootstrapped) before emitting logs from standalone component packages.</violation>
</file>

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

Re-trigger cubic

Comment thread packages/reflex-components-react-player/news/6864.misc.md
Comment thread packages/reflex-base/src/reflex_base/event/__init__.py
Comment thread tests/units/plugins/test_sitemap.py Outdated
@FarhanAliRaza
FarhanAliRaza force-pushed the farhan/eng-10963-log-2-migrate-base branch from 666df42 to 03b7704 Compare August 12, 2026 10:37
masenf
masenf previously approved these changes Aug 18, 2026
@FarhanAliRaza
FarhanAliRaza dismissed masenf’s stale review August 18, 2026 15:47

The merge-base changed after approval.

@FarhanAliRaza
FarhanAliRaza force-pushed the farhan/eng-10963-log-2-migrate-base branch from cc5b0a5 to 274376c Compare August 18, 2026 17:36
Base automatically changed from farhan/eng-10963-log-1-pipeline to main August 18, 2026 22:03
FarhanAliRaza and others added 2 commits August 19, 2026 03:03
Replace console.debug/info/warn/error call sites with per-module
logging.getLogger(__name__) loggers across reflex-base and the
component packages. No behavior change beyond the new sink.
- drop the console import left dead by the event handler warning migration
- scope the sitemap tests to the plugin's own logger so unrelated warnings
  cannot break the exact-count assertions
- name the news fragments after the PR
@FarhanAliRaza
FarhanAliRaza force-pushed the farhan/eng-10963-log-2-migrate-base branch from 274376c to ee282c1 Compare August 18, 2026 22:03
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.

3 participants