use console.debug instead of console.log
This commit is contained in:
parent
6a67438c83
commit
016e96ff04
3 changed files with 11 additions and 12 deletions
11
src/lib.rs
11
src/lib.rs
|
|
@ -6,7 +6,6 @@ extern crate serde;
|
|||
extern crate serde_wasm_bindgen;
|
||||
extern crate web_sys;
|
||||
|
||||
use js_sys::Math::sign;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use argus::expr::{Expr};
|
||||
|
|
@ -75,11 +74,11 @@ pub fn eval_boolean(s: &str, js_trace: JsValue) -> JsValue {
|
|||
}
|
||||
let m = TraceMap{traces: traceMap};
|
||||
for name in m.signal_names() {
|
||||
console::log_2(&JsValue::from_str("signal name:"), &JsValue::from_str(name));
|
||||
console::debug_2(&JsValue::from_str("signal name:"), &JsValue::from_str(name));
|
||||
let signal: &Signal<f64> = m.get(name).expect("bla");
|
||||
if let Signal::<f64>::Sampled { values, time_points } = signal {
|
||||
for i in 0..(values.len()) {
|
||||
console::log_2(
|
||||
console::debug_2(
|
||||
&JsValue::from_f64(time_points[i].as_millis() as f64),
|
||||
&JsValue::from_f64(values[i]));
|
||||
}
|
||||
|
|
@ -95,13 +94,13 @@ pub fn eval_boolean(s: &str, js_trace: JsValue) -> JsValue {
|
|||
return JsValue::from_str(format!("failed to parse expression: {}", joined).as_str());
|
||||
},
|
||||
};
|
||||
console::log_1(&JsValue::from_str("evaluating property..."));
|
||||
console::debug_1(&JsValue::from_str("evaluating property..."));
|
||||
// evaluate property on trace
|
||||
let eval_result = match expr {
|
||||
Expr::Bool(bool_expr) => BooleanSemantics::eval::<interpolation::Constant>(&bool_expr, &m),
|
||||
_ => return JsValue::from_str("expected boolean expression (this should never happen)"),
|
||||
};
|
||||
console::log_1(&JsValue::from_str("evaluated property"));
|
||||
console::debug_1(&JsValue::from_str("evaluated property"));
|
||||
let mut result = Vec::<StateBuddyEvalResultEntry>::new();
|
||||
match eval_result {
|
||||
Ok(r) => {
|
||||
|
|
@ -116,7 +115,7 @@ pub fn eval_boolean(s: &str, js_trace: JsValue) -> JsValue {
|
|||
return JsValue::from_str(format!("failed to evaluate expression: {}", e).as_str());
|
||||
}
|
||||
}
|
||||
console::log_1(&JsValue::from_str("now converting to JS value again"));
|
||||
console::debug_1(&JsValue::from_str("now converting to JS value again"));
|
||||
to_value(&StateBuddyEvalResult { entries: result }).expect("fuuuck")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue