layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Chore] Remove leftover debug `console.log` statements shipped to production

Open Ayush-1812 opened this issue 3 months ago • 3 comments

Description

Debug logging left in component code runs in the production bundle and writes to every visitor's browser console.

1. src/components/SistentNavigation/intra-page.js:68

const anchors = document.querySelectorAll(".main-content > a");
console.log(anchors);

IntraPage is rendered by SistentLayout, so this logs a NodeList on every Sistent documentation page load.

2. src/sections/Learn-Layer5/Course-Overview/index.js:165-169

{console.log(
  "lenght of the service mesh array: ",
  availableServiceMeshes.length,
)}
{console.log("array: ", availableServiceMeshes)}

Two logs embedded directly in JSX, so they fire on every render of the course overview page. (Note the lenght typo in the log text.) Because console.log returns undefined, these expressions render nothing — they are purely debug output.

3. src/sections/Home/So-Special-Section/index.js:124-125

Commented-out console.log calls that can be deleted as part of the same cleanup.

Expected Behavior

No debug logging in the production bundle. The three sites above should be removed. Genuine error reporting in catch blocks (e.g. CatalogGrid.js:29, Features-Col/index.js:80) is intentional and should stay, though console.error would be more appropriate than console.log for those.

Please note: src/sections/Projects/Sistent/getting-started/usage/index.js:95 also contains console.log('Form submitted:', formData), but that line lives inside a documentation code-sample string shown to readers as example code. It is not a bug and should be left alone.

Screenshots

N/A — open any Sistent component docs page with devtools and observe the logged NodeList.

Environment:

  • Host OS: any
  • Browser: any

Ayush-1812 avatar Aug 23 '26 04:08 Ayush-1812

I would like to work on this issue. Could you please assign it to me?

aroosaazeem6-dev avatar Aug 27 '26 09:08 aroosaazeem6-dev

Verified all three console.log sites on current main:

  1. src/components/SistentNavigation/intra-page.js:68 logs a NodeList on every Sistent docs page load
  2. src/sections/Learn-Layer5/Course-Overview/index.js:165-169 has two logs in JSX that fire on every render
  3. src/sections/Home/So-Special-Section/index.js:124-125 are commented-out logs we can delete in the same pass

I also checked the exclusions and they look right. usage/index.js:95 sits inside a docs code-sample string so it never runs, and the catch-block logs are there on purpose.

Proposed fix is simple: just delete the three spots above. Nothing depends on them, so it's a clean removal with no change in behavior.

Could you please assign this to me? I'd like to work on it.

@PARTH-TUSSLE @dhruveshmishra @Maanvi212006

ayushgade06 avatar Sep 25 '26 11:09 ayushgade06

Hi maintainers! 👋

I'd be glad to clean this up. I can scan the production codebase, remove leftover debug console.log statements, and verify clean local builds.

Could you please assign this issue to me?

VimalN2005 avatar Oct 16 '26 08:10 VimalN2005