Skip to content

Commit d8e285f

Browse files
Johan-Liebert1cgwalters
authored andcommitted
erofs/writer: Print trace logs instead of debug logs
Signed-off-by: Pragyan Poudyal <[email protected]>
1 parent 6884b98 commit d8e285f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

crates/composefs/src/erofs/writer.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
rc::Rc,
77
};
88

9-
use log::debug;
9+
use log::trace;
1010
use xxhash_rust::xxh32::xxh32;
1111
use zerocopy::{Immutable, IntoBytes};
1212

@@ -130,18 +130,18 @@ impl InodeXAttrs {
130130

131131
fn write(&self, output: &mut impl Output) {
132132
if self.filter != 0 {
133-
debug!(" write xattrs block");
133+
trace!(" write xattrs block");
134134
output.write_struct(format::InodeXAttrHeader {
135135
name_filter: (!self.filter).into(),
136136
shared_count: self.shared.len() as u8,
137137
..Default::default()
138138
});
139139
for idx in &self.shared {
140-
debug!(" shared {} @{}", idx, output.len());
140+
trace!(" shared {} @{}", idx, output.len());
141141
output.write(&output.get_xattr(*idx).to_le_bytes());
142142
}
143143
for attr in &self.local {
144-
debug!(" local @{}", output.len());
144+
trace!(" local @{}", output.len());
145145
attr.write(output);
146146
}
147147
}
@@ -157,15 +157,15 @@ impl<'a> Directory<'a> {
157157
let mut n_bytes = 0;
158158
let mut nlink = 0;
159159

160-
debug!("Directory with {} items", entries.len());
160+
trace!("Directory with {} items", entries.len());
161161

162162
// The content of the directory is fixed at this point so we may as well split it into
163163
// blocks. This lets us avoid measuring and re-measuring.
164164
for entry in entries.into_iter() {
165165
let entry_size = size_of::<format::DirectoryEntryHeader>() + entry.name.len();
166166
assert!(entry_size <= 4096);
167167

168-
debug!(" {:?}", entry.file_type);
168+
trace!(" {:?}", entry.file_type);
169169

170170
if matches!(entry.file_type, format::FileType::Directory) {
171171
nlink += 1;
@@ -176,7 +176,7 @@ impl<'a> Directory<'a> {
176176
rest.push(entry);
177177
} else {
178178
// It won't fit, so we need to store the existing entries in a block.
179-
debug!(" block {}", rest.len());
179+
trace!(" block {}", rest.len());
180180
blocks.push(rest.into_boxed_slice());
181181

182182
// Start over
@@ -192,7 +192,7 @@ impl<'a> Directory<'a> {
192192
n_bytes = 0;
193193
}
194194

195-
debug!(
195+
trace!(
196196
" blocks {} inline {} inline_size {n_bytes}",
197197
blocks.len(),
198198
rest.len()
@@ -208,11 +208,11 @@ impl<'a> Directory<'a> {
208208
}
209209

210210
fn write_block(&self, output: &mut impl Output, block: &[DirEnt]) {
211-
debug!(" write dir block {} @{}", block.len(), output.len());
211+
trace!(" write dir block {} @{}", block.len(), output.len());
212212
let mut nameofs = size_of::<format::DirectoryEntryHeader>() * block.len();
213213

214214
for entry in block {
215-
debug!(
215+
trace!(
216216
" entry {:?} name {} @{}",
217217
entry.file_type,
218218
nameofs,
@@ -228,13 +228,13 @@ impl<'a> Directory<'a> {
228228
}
229229

230230
for entry in block {
231-
debug!(" name @{}", output.len());
231+
trace!(" name @{}", output.len());
232232
output.write(entry.name.as_bytes());
233233
}
234234
}
235235

236236
fn write_inline(&self, output: &mut impl Output) {
237-
debug!(
237+
trace!(
238238
" write inline len {} expected size {} of {}",
239239
self.inline.len(),
240240
self.size % 4096,
@@ -338,15 +338,15 @@ impl<ObjectID: FsVerityHashValue> Inode<'_, ObjectID> {
338338
// The easiest thing to do is to add padding so that the inline data starts close
339339
// to the start of a fresh block boundary, while ensuring inode alignment.
340340
let pad = vec![0; 4096 - end_of_metadata % 4096];
341-
debug!("added pad {}", pad.len());
341+
trace!("added pad {}", pad.len());
342342
output.write(&pad);
343343
output.pad(32);
344344
}
345345
}
346346

347347
let format = format::InodeLayout::Extended | layout;
348348

349-
debug!(
349+
trace!(
350350
"write inode {idx} nid {} {:?} {:?} xattrsize{xattr_size} icount{} inline{} @{}",
351351
output.len() / 32,
352352
format,
@@ -662,7 +662,7 @@ impl Output for FirstPass {
662662
}
663663
assert_eq!(self.layout.offset_types.len(), offset_type as usize + 1);
664664

665-
debug!(
665+
trace!(
666666
"{:?} #{} @{}",
667667
offset_type,
668668
self.layout.offsets.len() - self.layout.offset_types[offset_type as usize],

0 commit comments

Comments
 (0)