fix: console command returns only Done due to JSON field name mismatch (#986)

The get_console_json() method produced JSON with key 'entries' containing
objects with 'level' field, but the output formatter in output.rs expected
key 'messages' with 'type' field. This mismatch caused console output to
fall through all format checks and print only '[Done]'.

Changed get_console_json() to use 'messages' and 'type' to match the
output formatter expectations.

Co-authored-by: xuyongliang <yongliang.xyl@alibaba-inc.com>
This commit is contained in:
xuyongliang
2026-03-24 10:28:06 -05:00
committed by GitHub
co-authored by xuyongliang
parent b5b84051e4
commit 3150acd574
+3 -3
View File
@@ -321,12 +321,12 @@ impl EventTracker {
}
pub fn get_console_json(&self) -> Value {
let entries: Vec<Value> = self
let messages: Vec<Value> = self
.console_entries
.iter()
.map(|e| json!({ "level": e.level, "text": e.text }))
.map(|e| json!({ "type": e.level, "text": e.text }))
.collect();
json!({ "entries": entries })
json!({ "messages": messages })
}
pub fn get_errors_json(&self) -> Value {