json-schema-org / json-schema-org/website

🐛 Bug: Refactor: Improve Error Logging Semantics and Reduce Production Console Noise

Open
#2,205 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 Bug Status: Triage
Dominant language
HTML
Stars
169
Forks
484
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Describe the bug

I've identified two areas where console logging practices could be improved for better observability and production hygiene:

1.Improper Error Level: In [components/GettingStarted.tsx] , caught errors are logged using console.log() instead of console.error().

  • Impact: Monitoring systems (like Sentry or Datadog) often rely on the error level to capture and alert on exceptions. Using log masks these events as info/debug messages.
Image

2.Production Noise: The [pages/tools/lib/postAnalytics.ts] file logs a success message ("Event posted successfully") to the console every time an analytics event fires.

  • Impact: This clutters the end-user's console in production environments, potentially obscuring legitimate warnings or errors from other scripts.
Steps To Reproduce

1.Error Level: In the local dev environment, modify GettingStarted.tsx to throw a mock error in
fetchData. Observe that it prints to the console in standard white text (Info level) rather than red (Error level).

2.Production Noise: Navigate to the Tools page (or any page triggering analytics). Open the browser console and observe the "Event posted successfully" message appearing on every interaction.

Expected Behavior
  • Exceptions: Should be consistently logged with console.error() to ensure they are properly categorized by browsers and monitoring tools.

  • Production Logs: Successful background operations should ideally be silent in production, or guarded by a debug flag, to keep the production console clean.

Are you working on this issue?
Yes

Do you think this work might require an [Architectural Decision Record (ADR)]?
No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with components/GettingStarted.tsx and pages/tools/lib/postAnalytics.ts, then reproduce the error and analytics interaction described in the issue. Check how each console message is emitted and verify that exceptions use the error level while successful analytics requests no longer create production console noise.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.