Add debug output for LazyFile::{get_file_mut,create_file}()

This commit is contained in:
Matthias Beyer 2016-01-28 21:00:33 +01:00
parent 2c398d941b
commit 4bc905c692

View file

@ -53,6 +53,7 @@ impl LazyFile {
* Get the mutable file behind a LazyFile object * Get the mutable file behind a LazyFile object
*/ */
pub fn get_file_mut(&mut self) -> Result<&mut File, StoreError> { pub fn get_file_mut(&mut self) -> Result<&mut File, StoreError> {
debug!("Getting lazy file: {:?}", self);
let file = match *self { let file = match *self {
LazyFile::File(ref mut f) => return { LazyFile::File(ref mut f) => return {
// We seek to the beginning of the file since we expect each // We seek to the beginning of the file since we expect each
@ -80,6 +81,7 @@ impl LazyFile {
* Create a file out of this LazyFile object * Create a file out of this LazyFile object
*/ */
pub fn create_file(&mut self) -> Result<&mut File, StoreError> { pub fn create_file(&mut self) -> Result<&mut File, StoreError> {
debug!("Creating lazy file: {:?}", self);
let file = match *self { let file = match *self {
LazyFile::File(ref mut f) => return Ok(f), LazyFile::File(ref mut f) => return Ok(f),
LazyFile::Absent(ref p) => { LazyFile::Absent(ref p) => {