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: README.md
+28-8Lines changed: 28 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,11 +126,30 @@ import { globalErrorHandler } from 'express-error-toolkit';
126
126
app.use(globalErrorHandler);
127
127
```
128
128
129
-
By default, it includes stack trace and logs the error in development (`NODE_ENV=development`).
129
+
By default, the handler includes the stack trace and logs the error in development.
130
+
In production (`NODE_ENV=production`), both are automatically suppressed for safety.
130
131
131
132
---
132
133
133
-
### 5. **Set Options Globally (Optional)**
134
+
### 5. 🖍️ Readable Console Logs with ANSI Colors
135
+
136
+
To enhance developer experience during debugging, this toolkit uses **ANSI escape codes** to style console logs — **no external dependencies** like `chalk`.
137
+
138
+
Each part of the error log is color-coded using a traffic light scheme:
139
+
140
+
- 🔴 **Error Message** – Red
141
+
- 🟡 **Error Details** – Yellow
142
+
- 🟢 **Stack Trace** – Green
143
+
144
+
> Here's an example of how your console might look in development:
0 commit comments