Skip to content

Commit

Permalink
marionette: reduce importance of marionette communication
Browse files Browse the repository at this point in the history
The log messages of what geckodriver sends and receives from the
Marionette server will now be logged at trace level.  This brings parity
to the way protocol chatter is logged in the Marionette server.
  • Loading branch information
andreastt authored and jgraham committed Apr 12, 2017
1 parent baf5451 commit 15345b6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/marionette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,15 +1142,14 @@ impl MarionetteConnection {
let poll_attempts = timeout / poll_interval;
let mut poll_attempt = 0;

info!("Connecting to Marionette on {}:{}", DEFAULT_HOST, self.port);
loop {
match TcpStream::connect(&(DEFAULT_HOST, self.port)) {
Ok(stream) => {
self.stream = Some(stream);
break
},
Err(e) => {
debug!(" connection attempt {}/{}", poll_attempt, poll_attempts);
trace!(" connection attempt {}/{}", poll_attempt, poll_attempts);
if poll_attempt <= poll_attempts {
poll_attempt += 1;
sleep(Duration::from_millis(poll_interval));
Expand All @@ -1162,7 +1161,7 @@ impl MarionetteConnection {
}
};

debug!("TCP connection established");
debug!("Connected to Marionette on {}:{}", DEFAULT_HOST, self.port);

try!(self.handshake());
Ok(())
Expand Down Expand Up @@ -1217,7 +1216,7 @@ impl MarionetteConnection {

fn send(&mut self, msg: Json) -> WebDriverResult<String> {
let data = self.encode_msg(msg);
debug!("→ {}", data);
trace!("→ {}", data);

match self.stream {
Some(ref mut stream) => {
Expand Down Expand Up @@ -1291,7 +1290,7 @@ impl MarionetteConnection {

// TODO(jgraham): Need to handle the error here
let data = String::from_utf8(payload).unwrap();
debug!("← {}", data);
trace!("← {}", data);

Ok(data)
}
Expand Down

0 comments on commit 15345b6

Please sign in to comment.