#[throws(ME)]
fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse {
- eprintln!("command connection {}: executing {:?}", &cs.desc, &cmd);
+ info!("command connection {}: executing {:?}", &cs.desc, &cmd);
match cmd {
Noop => Fine,
.map_err(|e|{
let name = ig.name.clone();
Instance::destroy_game(ig)
- .unwrap_or_else(|e|
- eprintln!("failed to tidy up failecd creation of {:?}: {:?}",
- &name, &e));
+ .unwrap_or_else(|e| warn!(
+ "failed to tidy up failecd creation of {:?}: {:?}",
+ &name, &e
+ ));
e
})?;
thread::spawn(move ||{
loop {
self.accept_one().unwrap_or_else(
- |e| eprintln!("accept/spawn failed: {:?}", e)
+ |e| error!("accept/spawn failed: {:?}", e)
);
}
})
fn accept_one(&mut self) {
let (conn, _caller) = self.listener.accept().context("accept")?;
let mut desc = format!("{:>5}", conn.as_raw_fd());
- eprintln!("command connection {}: accepted", &desc);
+ info!("command connection {}: accepted", &desc);
thread::spawn(move||{
match (||{
let euid = conn.initial_peer_credentials()
<Result<_,StartupError>>::Ok(())
})() {
- Ok(()) => eprintln!("command connection {}: disconnected", &desc),
- Err(e) => eprintln!("command connection {}: error: {:?}", &desc, e),
+ Ok(()) => info!("command connection {}: disconnected", &desc),
+ Err(e) => warn!("command connection {}: error: {:?}", &desc, e),
}
});
}
}
fn map_auth_err(&self, ae: AuthorisationError) -> MgmtError {
- eprintln!("command connection {}: authorisation error: {}",
- self.desc, ae.0);
+ warn!("command connection {}: authorisation error: {}",
+ self.desc, ae.0);
MgmtError::AuthorisationError
}
}