You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/routes/docs/(qwikcity)/guides/debugging/index.mdx
+80-1Lines changed: 80 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@ title: Debugging | Introduction
3
3
description: Learn a few debugging tips to streamline your journey with Qwik.
4
4
contributors:
5
5
- gioboa
6
-
updated_at: '2025-08-08T00:00:00Z'
6
+
- KyeongJooni
7
+
updated_at: '2025-12-13T00:00:00Z'
7
8
created_at: '2025-08-08T00:00:00Z'
8
9
---
9
10
# Debugging
@@ -19,3 +20,81 @@ If it guesses wrong, no biggie! Just give Qwik a hint by setting the `LAUNCH_EDI
19
20
For example, if you're on a Mac and use VS Code, you'd type `export LAUNCH_EDITOR=code` in your terminal.
20
21
21
22
Under the hood [launch-editor library](https://github.com/yyx990803/launch-editor/tree/master) is used, here are the [supported editors](https://github.com/yyx990803/launch-editor/tree/master?tab=readme-ov-file#supported-editors)
23
+
24
+
## Finding leftover `console.log` statements
25
+
26
+
When working on larger codebases, you might occasionally leave `console.log` statements in your code unintentionally. These can clutter your terminal output, and it's often difficult to identify which file and line number produced each log message.
27
+
28
+
### Using ESLint rules (recommended)
29
+
30
+
The recommended approach is to configure ESLint to prevent `console.log` statements from being committed:
This will catch `console.log` statements during development, preventing them from being committed.
44
+
45
+
### Using IDE search
46
+
47
+
Most IDEs provide powerful search functionality to find all occurrences of `console.log` across your codebase:
48
+
-**VS Code**: Press `Ctrl+Shift+F` (or `Cmd+Shift+F` on Mac) and search for `console\.log`
49
+
-**Enable regex mode** to match only exact `console.log` calls and not `console.error` or `console.warn`
50
+
51
+
This approach is simple but requires manual review of each occurrence to determine if it's intentional or leftover debug code.
52
+
53
+
### Using stack traces (temporary debugging)
54
+
55
+
If you need to identify existing leftover console.logs in a codebase that's already cluttered, you can temporarily override `console.log` to include stack traces.
56
+
57
+
#### In client-side components
58
+
59
+
You can override `console.log` in your component code:
0 commit comments