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
+75-14Lines changed: 75 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,12 @@ A lightweight, embeddable development dashboard for Go applications. Monitor log
9
9
-**Logs**: Capture and browse structured logs with filtering and detail view
10
10
-**HTTP Client**: Monitor outgoing HTTP requests with timing, headers, and response info
11
11
-**HTTP Server**: Track incoming HTTP requests to your application
12
-
-**Low Overhead**: Designed to be lightweight to run in development and testing setups
12
+
-**SQL Queries**: Monitor database queries with timing and arguments
13
+
-**On-Demand Capture**: Start/stop capturing through the dashboard UI with session or global modes
14
+
-**Multi-User Isolation**: Each user gets their own event storage with independent clearing
15
+
-**Low Overhead**: Designed to be lightweight; no events captured until you start a session
13
16
-**Easy to Integrate**: Embeds into your application with minimal configuration
14
-
-**Realtime**: See events as they occur
17
+
-**Realtime**: See events as they occur via Server-Sent Events
15
18
-**Clean UI**: Modern, minimalist interface with responsive design
16
19
17
20
## Note
@@ -86,6 +89,21 @@ See [example](example/main.go) for a more complete example showing all features.
86
89
87
90
## Usage
88
91
92
+
### Capture Sessions
93
+
94
+
By default, no events are collected until a user starts a capture session through the dashboard UI. This on-demand approach:
95
+
96
+
- Reduces overhead when not actively debugging
97
+
- Provides isolation between users (each gets their own event storage)
98
+
- Allows clearing events without affecting other users
99
+
100
+
**Capture Modes:**
101
+
102
+
-**Session Mode** (default): Only captures events from HTTP requests that include your session cookie. Useful for isolating your own requests in a shared environment.
103
+
-**Global Mode**: Captures all events from all requests. Useful when you need to see everything happening in the application.
104
+
105
+
Toggle between modes using the buttons in the dashboard header.
106
+
89
107
### Capturing Logs
90
108
91
109
devlog integrates with Go's `slog` package:
@@ -250,28 +268,71 @@ The collected queries will be visible in the devlog dashboard, showing:
250
268
251
269
### Configuring the Dashboard
252
270
253
-
Use options to customize the dashboard:
271
+
Use functional options to customize the dashboard handler:
254
272
255
273
```go
256
-
dashboard:= devlog.NewWithOptions(devlog.Options{
257
-
LogCapacity: 1000, // Maximum number of log entries to keep
258
-
HTTPClientCapacity: 100, // Maximum number of HTTP client requests to keep
259
-
HTTPServerCapacity: 100, // Maximum number of HTTP server requests to keep
260
-
SQLCapacity: 100, // Maximum number of SQL queries to keep
0 commit comments