@@ -106,7 +106,7 @@ impl FsStore {
106106 . map_err ( |e| Error ( ErrorKind :: ErrReadingLevel1Path ( entry. path ( ) , e) ) ) ?
107107 . is_file ( )
108108 {
109- tracing:: warn !(
109+ tracing:: trace !(
110110 non_dir_path=%entry. path( ) . display( ) ,
111111 "unexpected non-directory at level1 of database"
112112 ) ;
@@ -123,14 +123,14 @@ impl FsStore {
123123 . metadata ( )
124124 . map_err ( |e| Error ( ErrorKind :: ErrReadingLevel2Path ( entry. path ( ) , e) ) ) ?;
125125 if !metadata. is_dir ( ) {
126- tracing:: warn !(
126+ tracing:: trace !(
127127 non_file_path=%entry. path( ) . display( ) ,
128128 "unexpected non-directory at level2 of database"
129129 ) ;
130130 continue ;
131131 }
132132 let Some ( doc_paths) = DocIdPaths :: parse ( entry. path ( ) ) else {
133- tracing:: warn !(
133+ tracing:: trace !(
134134 non_doc_path=%entry. path( ) . display( ) ,
135135 "unexpected non-document path at level2 of database"
136136 ) ;
@@ -157,31 +157,27 @@ impl FsStore {
157157 // Load all the data we have into a doc
158158 match Chunks :: load ( & self . root , id) {
159159 Ok ( Some ( chunks) ) => {
160- println ! ( "hmm..." ) ;
161160 let doc = chunks
162161 . to_doc ( )
163162 . map_err ( |e| Error ( ErrorKind :: LoadDocToCompact ( e) ) ) ?;
164163
165164 // Write the snapshot
166165 let output_chunk_name = SavedChunkName :: new_snapshot ( doc. get_heads ( ) ) ;
167166 let chunk = doc. save ( ) ;
168- println ! ( "Going to write: {:#?}" , output_chunk_name) ;
169167 write_chunk ( & self . root , & paths, & chunk, output_chunk_name. clone ( ) ) ?;
170168
171169 // Remove all the old data
172170 for incremental in chunks. incrementals . keys ( ) {
173171 let path = paths. chunk_path ( & self . root , incremental) ;
174- println ! ( "Removing {:?}" , path) ;
175172 std:: fs:: remove_file ( & path)
176173 . map_err ( |e| Error ( ErrorKind :: DeleteChunk ( path, e) ) ) ?;
177174 }
178175 let just_wrote = paths. chunk_path ( & self . root , & output_chunk_name) ;
179176 for snapshot in chunks. snapshots . keys ( ) {
180177 let path = paths. chunk_path ( & self . root , snapshot) ;
181- println ! ( "Removing Snap {:?}" , path) ;
182178
183179 if path == just_wrote {
184- tracing:: error !( "Somehow trying to delete the same path we just wrote to. Not today Satan" ) ;
180+ tracing:: trace !( "Somehow trying to delete the same path we just wrote to. Not today Satan" ) ;
185181 continue ;
186182 }
187183
@@ -190,7 +186,6 @@ impl FsStore {
190186 }
191187 }
192188 Ok ( None ) => {
193- println ! ( "No existing files,and compaction requested first" ) ;
194189 let output_chunk_name = SavedChunkName {
195190 hash : uuid:: Uuid :: new_v4 ( ) . as_bytes ( ) . to_vec ( ) ,
196191 chunk_type : ChunkType :: Snapshot ,
@@ -199,7 +194,6 @@ impl FsStore {
199194 write_chunk ( & self . root , & paths, full_doc, output_chunk_name) ?;
200195 }
201196 Err ( e) => {
202- println ! ( "Error loading chunks for {:?} {}" , self . root, id) ;
203197 tracing:: error!( e=%e, "Error loading chunks" ) ;
204198 }
205199 }
@@ -233,8 +227,8 @@ fn write_chunk(
233227 // with a name based on the hash of the heads of the document
234228 let output_path = paths. chunk_path ( root, & name) ;
235229
236- tracing:: warn !( "Renaming: {:?}" , temp_save) ;
237- tracing:: warn !( "To: {:?}" , output_path) ;
230+ tracing:: trace !( "Renaming: {:?}" , temp_save) ;
231+ tracing:: trace !( "To: {:?}" , output_path) ;
238232
239233 std:: fs:: rename ( & temp_save_path, & output_path)
240234 . map_err ( |e| Error ( ErrorKind :: RenameTempFile ( temp_save_path, output_path, e) ) ) ?;
@@ -372,7 +366,7 @@ impl Chunks {
372366 fn load ( root : & Path , doc_id : & DocumentId ) -> Result < Option < Self > , Error > {
373367 let doc_id_hash = DocIdPaths :: from ( doc_id) ;
374368 let level2_path = doc_id_hash. level2_path ( root) ;
375- tracing:: warn !(
369+ tracing:: trace !(
376370 root=%root. display( ) ,
377371 doc_id=?doc_id,
378372 doc_path=%level2_path. display( ) ,
@@ -408,12 +402,12 @@ impl Chunks {
408402 . map_err ( |e| Error ( ErrorKind :: ErrReadingChunkFileMetadata ( path. clone ( ) , e) ) ) ?
409403 . is_file ( )
410404 {
411- tracing:: warn !( bad_file=%path. display( ) , "unexpected non-file in level2 path" ) ;
405+ tracing:: trace !( bad_file=%path. display( ) , "unexpected non-file in level2 path" ) ;
412406 continue ;
413407 }
414408 let Some ( chunk_name) = entry. file_name ( ) . to_str ( ) . and_then ( SavedChunkName :: parse)
415409 else {
416- tracing:: warn !( bad_file=%path. display( ) , "unexpected non-chunk file in level2 path" ) ;
410+ tracing:: trace !( bad_file=%path. display( ) , "unexpected non-chunk file in level2 path" ) ;
417411 continue ;
418412 } ;
419413 tracing:: debug!( chunk_path=%path. display( ) , "reading chunk file" ) ;
@@ -423,7 +417,7 @@ impl Chunks {
423417 match e. kind ( ) {
424418 std:: io:: ErrorKind :: NotFound => {
425419 // Could be a concurrent process compacting, not an error
426- tracing:: warn !(
420+ tracing:: trace !(
427421 missing_chunk_path=%path. display( ) ,
428422 "chunk file disappeared while reading chunks" ,
429423 ) ;
0 commit comments