geckodriver: Make trace logs safe for windows prompt (#722)
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 08 May 2017 14:44:54 +0100
changeset 581815 21af7364b9b95397f8b75d4769a922a0fb2d8d04
parent 581814 f40b4c89ce2929a7c2c3c2115380149755240612
child 581816 2222a2e846f757200cd86848976cce36198b70ba
push id59896
push userhikezoe@mozilla.com
push dateFri, 19 May 2017 23:30:01 +0000
milestone55.0a1
geckodriver: Make trace logs safe for windows prompt (#722) * marionette: make trace logs safe for windows prompt The symbols "←" and "→" are encodeed as "?" in the Windows command prompt. To make the logs from this system useful, use ASCII versions of the arrows. Source-Repo: https://github.com/mozilla/geckodriver Source-Revision: 60e7a430dc38a9e1921928c0cd996bb5fc00198b committer: jgraham <james@hoppipolla.co.uk> IGNORE BAD COMMIT MESSAGES
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -1347,17 +1347,17 @@ impl MarionetteConnection {
         let resp_data = try!(self.send(command.to_json()));
         let json_data: Json = try!(Json::from_str(&*resp_data));
 
         self.session.response(msg, try!(MarionetteResponse::from_json(&json_data)))
     }
 
     fn send(&mut self, msg: Json) -> WebDriverResult<String> {
         let data = self.encode_msg(msg);
-        trace!("→ {}", data);
+        trace!("-> {}", data);
 
         match self.stream {
             Some(ref mut stream) => {
                 if stream.write(&*data.as_bytes()).is_err() {
                     let mut err = WebDriverError::new(ErrorStatus::UnknownError,
                                                       "Failed to write response to stream");
                     err.delete_session = true;
                     return Err(err);
@@ -1421,17 +1421,17 @@ impl MarionetteConnection {
             total_read += num_read;
             for x in &buf[..num_read] {
                 payload.push(*x);
             }
         }
 
         // TODO(jgraham): Need to handle the error here
         let data = String::from_utf8(payload).unwrap();
-        trace!("← {}", data);
+        trace!("<- {}", data);
 
         Ok(data)
     }
 }
 
 trait ToMarionette {
     fn to_marionette(&self) -> WebDriverResult<BTreeMap<String, Json>>;
 }