Skip to content

fix(wassette): send log to stderr for stdio transport#86

Merged
asw101 merged 2 commits intomainfrom
mossaka/log-to-stderr
Aug 5, 2025
Merged

fix(wassette): send log to stderr for stdio transport#86
asw101 merged 2 commits intomainfrom
mossaka/log-to-stderr

Conversation

@Mossaka
Copy link
Copy Markdown
Collaborator

@Mossaka Mossaka commented Aug 5, 2025

This closes #73

Signed-off-by: Jiaxiao Zhou duibao55328@gmail.com

Mossaka and others added 2 commits August 5, 2025 11:35
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Aaron Wislang <aaron.wislang@microsoft.com>
Comment on lines +204 to +209
let env_filter = tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| {
"info,cranelift_codegen=warn,cranelift_entity=warn,cranelift_bforest=warn,cranelift_frontend=warn"
.to_string()
.into()
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let env_filter = tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| {
"info,cranelift_codegen=warn,cranelift_entity=warn,cranelift_bforest=warn,cranelift_frontend=warn"
.to_string()
.into()
});
let env_filter =
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| {
if env::var("RUST_LOG").is_ok() {
"info,cranelift_codegen=warn,cranelift_entity=warn,cranelift_bforest=warn,cranelift_frontend=warn"
.to_string()
.into()
} else {
"warn,cranelift_codegen=warn,cranelift_entity=warn,cranelift_bforest=warn,cranelift_frontend=warn"
.to_string()
.into()
}
});

I've disabled ANSII escape codes but added this optional tweak. If RUST_LOG is set, we change the level from warn to info to get the logging depth we had before.

This is because VS Code will still output the following [warning] for any output on stderr.

2025-08-05 15:46:04.454 [warning] [server stderr] 2025-08-05T19:46:04.452371Z  INFO handle_tools_list:get_component_tools: mcp_server::components: Total tools collected: 0

However, it is not trying to parse it, so I think it's OK to merge and leave as-is for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge in the meantime.

@asw101
Copy link
Copy Markdown
Member

asw101 commented Aug 5, 2025

Tested and looks great to me, thank you @Mossaka!

@asw101 asw101 merged commit 6c682e7 into main Aug 5, 2025
5 checks passed
@asw101 asw101 deleted the mossaka/log-to-stderr branch August 5, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUST_LOG=off is required to stop MCP clients such as VS Code from parsing the logging output

2 participants