-
Notifications
You must be signed in to change notification settings - Fork 133
Add --no-log
argument to make it work with IntelliJ
#127
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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -32,6 +32,9 @@ const pid = process.pid | |||||||
// Global debug flag | ||||||||
export let DEBUG = false | ||||||||
|
||||||||
// Global no-log flag | ||||||||
export let NO_LOG = false | ||||||||
|
||||||||
// Helper function for timestamp formatting | ||||||||
function getTimestamp(): string { | ||||||||
const now = new Date() | ||||||||
|
@@ -71,6 +74,10 @@ export function debugLog(message: string, ...args: any[]) { | |||||||
} | ||||||||
|
||||||||
export function log(str: string, ...rest: unknown[]) { | ||||||||
if(NO_LOG) { | ||||||||
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. Can we have this control just the console.error below so that the DEBUG log functionality is preserved?
Suggested change
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. @benconda But this also brings in a bigger question - wouldn't this result in valid error logs from server being lost? How would the remote server communicate error msgs as per the protocol and how does mcp-remote handle it currently? |
||||||||
return | ||||||||
} | ||||||||
|
||||||||
// Using stderr so that it doesn't interfere with stdout | ||||||||
console.error(`[${pid}] ${str}`, ...rest) | ||||||||
|
||||||||
|
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.
Might be better to rename this to
NO_STDERR_LOG
(and the corresponding cli arg to--no-stderr-log
) to be more explicit and clear.