json-schema-org / json-schema-org/website
🐛 Bug: Refactor: Improve Error Logging Semantics and Reduce Production Console Noise
Nobody has claimed this yet.
- 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
logmasks these events as info/debug messages.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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