Add more logging to session

This commit is contained in:
Drakulix 2017-11-25 13:55:26 +01:00
parent 606efebe1b
commit 24f2d499f3
1 changed files with 5 additions and 2 deletions

View File

@ -250,11 +250,14 @@ impl Session for DirectSession {
type Error = NixError; type Error = NixError;
fn open(&mut self, path: &Path, flags: OFlag) -> NixResult<RawFd> { fn open(&mut self, path: &Path, flags: OFlag) -> NixResult<RawFd> {
info!(self.logger, "Opening device: {:?}", path); debug!(self.logger, "Opening device: {:?}", path);
open(path, flags, Mode::empty()) let fd = open(path, flags, Mode::empty())?;
trace!(self.logger, "Fd num: {:?}", fd);
Ok(fd)
} }
fn close(&mut self, fd: RawFd) -> NixResult<()> { fn close(&mut self, fd: RawFd) -> NixResult<()> {
debug!(self.logger, "Closing device: {:?}", fd);
close(fd) close(fd)
} }