-
Notifications
You must be signed in to change notification settings - Fork 36
Update log level when configuring websocket #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -449,13 +449,20 @@ func (h *Handler) connect(wsURL, token string) (*websocket.Conn, error) { | |||||
| // logDiagnostic writes a diagnostic message to the specified writer. | ||||||
| // This is used for logging infrastructure issues (not application logs). | ||||||
| // Messages are written as JSON to maintain consistency with application logs. | ||||||
| // The log level is determined by the writer: stderr produces error level, stdout produces info level. | ||||||
| func logDiagnostic(w io.Writer, format string, args ...any) { | ||||||
| message := fmt.Sprintf(format, args...) | ||||||
| // trim trailing newline if present (we'll add it back after JSON) | ||||||
| message = strings.TrimSuffix(message, "\n") | ||||||
|
|
||||||
| // determine log level based on the writer | ||||||
| level := "info" | ||||||
| if w == os.Stderr { | ||||||
| level = "error" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be dropped. When using
Suggested change
https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#stdio |
||||||
| } | ||||||
|
|
||||||
| entry := map[string]any{ | ||||||
| "level": "ERROR", | ||||||
| "level": level, | ||||||
| "msg": message, | ||||||
| "source": "wslogging", | ||||||
| "time": time.Now().UTC().Format(time.RFC3339Nano), | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be debug by default since they will potentially be very noisy.