Skip to content

ENG-10963 feat(log): deprecate the legacy console logging helpers (5/5) - #6867

Open
FarhanAliRaza wants to merge 1 commit into
farhan/eng-10963-log-4-hosting-clifrom
farhan/eng-10963-log-5-deprecate-console
Open

ENG-10963 feat(log): deprecate the legacy console logging helpers (5/5)#6867
FarhanAliRaza wants to merge 1 commit into
farhan/eng-10963-log-4-hosting-clifrom
farhan/eng-10963-log-5-deprecate-console

Conversation

@FarhanAliRaza

@FarhanAliRaza FarhanAliRaza commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

With every call site migrated, console.debug/info/success/log/warn/error/timing now emit a runtime deprecation warning (removal in 1.0) and are marked with typing_extensions.deprecated for type-level warnings. Behavior is otherwise unchanged; the interactive Rich features (print/rule/status/ask/progress) remain first-class.

This must land last: the deprecation markers only pass CI once no in-repo call site uses the helpers.

Stack (ENG-10963)

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

Review in cubic

console.debug/info/success/log/warn/error/timing now emit a runtime
deprecation warning (removal in 1.0) and are marked with
typing_extensions.deprecated for type-level warnings. Behavior is
otherwise unchanged; the interactive Rich features (print/rule/
status/ask/progress) remain first-class.
@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 deprecates the legacy console logging helpers at runtime and for static type checking while retaining their existing rendering behavior.

  • Adds centralized runtime deprecation notices for debug, info, success, log, warn, error, and timing.
  • Marks the helpers as deprecated for type checkers and documents their replacements.
  • Adds regression tests for delegation and preservation of Rich rendering arguments.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified.

The deprecated helpers retain their previous rendering paths, timing avoids a duplicate deprecation notice through the extracted debug implementation, and the tests cover the principal compatibility contracts.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/utils/console.py Adds runtime and type-level deprecation markers while extracting the unchanged debug implementation for internal timing use.
tests/units/reflex_base/utils/test_log.py Adds coverage for shim output and preservation of Rich print, log, and progress behavior.
packages/reflex-base/news/+eng-10963-console-deprecate.deprecation.md Documents the deprecated helpers, planned removal, replacements, and unaffected interactive APIs.

Reviews (1): Last reviewed commit: "feat(log): deprecate the legacy console ..." | 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
⏩ 8 skipped benchmarks1


Comparing farhan/eng-10963-log-5-deprecate-console (a3b76f4) with farhan/eng-10963-log-4-hosting-cli (963fc1b)

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.

@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: a3b76f45c9

ℹ️ 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".

if TYPE_CHECKING:
from typing_extensions import deprecated

debug = deprecated("Use logging.getLogger(__name__).debug(msg) instead")(debug)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Declare deprecated shims with decorator syntax

When consumers enable Pyright's reportDeprecated, none of these seven helpers produces a diagnostic because Pyright does not propagate PEP 702 metadata through an arbitrary deprecated(...)(function) assignment (verified with Pyright 1.1.409); it recognizes @deprecated(...) on a declaration instead. Consequently, the advertised type-level deprecation is ineffective, so provide TYPE_CHECKING declarations decorated with @deprecated while retaining the runtime implementations in the alternate branch.

AGENTS.md reference: AGENTS.md:L110-L119

Useful? React with 👍 / 👎.

@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 3 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-base/src/reflex_base/utils/console.py">

<violation number="1" location="packages/reflex-base/src/reflex_base/utils/console.py:601">
P2: The TYPE_CHECKING shim reassigns each function via `deprecated(...)(fn)` rather than applying `@deprecated` directly on a declaration. Type checkers like Pyright generally detect `reportDeprecated` diagnostics based on syntactic `@deprecated` decoration rather than an arbitrary functional call/reassignment, so this pattern may fail to produce the intended type-level deprecation warnings for callers using Pyright's `reportDeprecated`. Consider declaring stub functions under `TYPE_CHECKING` decorated directly with `@deprecated`, keeping the runtime implementation in the else branch.</violation>
</file>

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

Re-trigger cubic

if TYPE_CHECKING:
from typing_extensions import deprecated

debug = deprecated("Use logging.getLogger(__name__).debug(msg) instead")(debug)

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.

P2: The TYPE_CHECKING shim reassigns each function via deprecated(...)(fn) rather than applying @deprecated directly on a declaration. Type checkers like Pyright generally detect reportDeprecated diagnostics based on syntactic @deprecated decoration rather than an arbitrary functional call/reassignment, so this pattern may fail to produce the intended type-level deprecation warnings for callers using Pyright's reportDeprecated. Consider declaring stub functions under TYPE_CHECKING decorated directly with @deprecated, keeping the runtime implementation in the else branch.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/reflex-base/src/reflex_base/utils/console.py, line 601:

<comment>The TYPE_CHECKING shim reassigns each function via `deprecated(...)(fn)` rather than applying `@deprecated` directly on a declaration. Type checkers like Pyright generally detect `reportDeprecated` diagnostics based on syntactic `@deprecated` decoration rather than an arbitrary functional call/reassignment, so this pattern may fail to produce the intended type-level deprecation warnings for callers using Pyright's `reportDeprecated`. Consider declaring stub functions under `TYPE_CHECKING` decorated directly with `@deprecated`, keeping the runtime implementation in the else branch.</comment>

<file context>
@@ -559,3 +593,17 @@ def start(self):
+if TYPE_CHECKING:
+    from typing_extensions import deprecated
+
+    debug = deprecated("Use logging.getLogger(__name__).debug(msg) instead")(debug)
+    info = deprecated("Use logging.getLogger(__name__).info(msg) instead")(info)
+    success = deprecated(
</file context>

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