Put back rudimentary debug output

This commit is contained in:
greg
2019-05-28 03:41:49 -07:00
parent 856c0f95ce
commit 78d1e93e4b
2 changed files with 25 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ use std::collections::HashSet;
use colored::*;
use crate::language::{ProgrammingLanguageInterface,
ComputationRequest, ComputationResponse,
LangMetaRequest, LangMetaResponse};
DebugAsk};
mod command_tree;
use self::command_tree::{CommandTree, BoxedCommandFunction};
@@ -202,6 +202,16 @@ impl Repl {
buf.push_str(&format!("{:?}\n", response.global_output_stats.stage_durations));
}
for debug_resp in response.debug_responses {
let stage_name = match debug_resp.ask {
DebugAsk::ByStage { stage_name } => stage_name,
_ => continue,
};
let s = format!("{} - {}\n", stage_name, debug_resp.value);
buf.push_str(&s);
}
buf.push_str(&match response.main_output {
Ok(s) => s,
Err(e) => format!("{} {}", "Error".red(), e)