Skip to content

Commit

Permalink
Downgrade some of wgpu_core's logging level from info to trace and de…
Browse files Browse the repository at this point in the history
…bug (#4771)

* Downgrade storage log level from info to trace

* Downgrade tracking log level from info to trace

* Demote present log from info to debug

* Downgrade device/life.rs log from info to debug and trace

* Downgrade more log from info to trace
  • Loading branch information
nical authored Nov 24, 2023
1 parent 350c963 commit ca4e131
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion wgpu-core/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl<A: HalApi> CommandBuffer<A> {
}

pub(crate) fn extract_baked_commands(&mut self) -> BakedCommands<A> {
log::info!(
log::trace!(
"Extracting BakedCommands from CommandBuffer {:?}",
self.info.label()
);
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/device/life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl<A: HalApi> LifetimeTracker<A> {

let mut work_done_closures: SmallVec<_> = self.work_done_closures.drain(..).collect();
for a in self.active.drain(..done_count) {
log::info!("Active submission {} is done", a.index);
log::debug!("Active submission {} is done", a.index);
self.free_resources.extend(a.last_resources);
self.ready_to_map.extend(a.mapped);
for encoder in a.encoders {
Expand Down Expand Up @@ -979,7 +979,7 @@ impl<A: HalApi> LifetimeTracker<A> {
};
if is_removed {
*buffer.map_state.lock() = resource::BufferMapState::Idle;
log::info!("Buffer ready to map {:?} is not tracked anymore", buffer_id);
log::trace!("Buffer ready to map {:?} is not tracked anymore", buffer_id);
self.free_resources.insert(buffer_id, buffer.clone());
} else {
let mapping = match std::mem::replace(
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
};

let (id, resource) = fid.assign(texture);
log::info!("Created CURRENT Surface Texture {:?}", id);
log::debug!("Created CURRENT Surface Texture {:?}", id);

{
// register it in the device tracker as uninitialized
Expand Down
8 changes: 4 additions & 4 deletions wgpu-core/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ where
}

pub(crate) fn insert(&mut self, id: I, value: Arc<T>) {
log::info!("User is inserting {}{:?}", T::TYPE, id);
log::trace!("User is inserting {}{:?}", T::TYPE, id);
let (index, epoch, _backend) = id.unzip();
self.insert_impl(index as usize, epoch, Element::Occupied(value, epoch))
}

pub(crate) fn insert_error(&mut self, id: I, label: &str) {
log::info!("User is insering as error {}{:?}", T::TYPE, id);
log::trace!("User is insering as error {}{:?}", T::TYPE, id);
let (index, epoch, _) = id.unzip();
self.insert_impl(
index as usize,
Expand Down Expand Up @@ -225,13 +225,13 @@ where
}

pub(crate) fn force_replace(&mut self, id: I, value: T) {
log::info!("User is replacing {}{:?}", T::TYPE, id);
log::trace!("User is replacing {}{:?}", T::TYPE, id);
let (index, epoch, _) = id.unzip();
self.map[index as usize] = Element::Occupied(Arc::new(value), epoch);
}

pub(crate) fn remove(&mut self, id: I) -> Option<Arc<T>> {
log::info!("User is removing {}{:?}", T::TYPE, id);
log::trace!("User is removing {}{:?}", T::TYPE, id);
let (index, epoch, _) = id.unzip();
match std::mem::replace(&mut self.map[index as usize], Element::Vacant) {
Element::Occupied(value, storage_epoch) | Element::Destroyed(value, storage_epoch) => {
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ impl<A: HalApi> ResourceTracker<BufferId, Buffer<A>> for BufferTracker<A> {
let min_ref_count = 1 + external_count;
if existing_ref_count <= min_ref_count {
self.metadata.remove(index);
log::info!("Buffer {:?} is not tracked anymore", id,);
log::trace!("Buffer {:?} is not tracked anymore", id,);
return true;
} else {
log::info!(
log::trace!(
"Buffer {:?} is still referenced from {}",
id,
existing_ref_count
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/stateless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ impl<A: HalApi, Id: TypedId, T: Resource<Id>> ResourceTracker<Id, T>
let min_ref_count = 1 + external_count;
if existing_ref_count <= min_ref_count {
self.metadata.remove(index);
log::info!("{} {:?} is not tracked anymore", T::TYPE, id,);
log::trace!("{} {:?} is not tracked anymore", T::TYPE, id,);
return true;
} else {
log::info!(
log::trace!(
"{} {:?} is still referenced from {}",
T::TYPE,
id,
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ impl<A: HalApi> ResourceTracker<TextureId, Texture<A>> for TextureTracker<A> {
self.start_set.complex.remove(&index);
self.end_set.complex.remove(&index);
self.metadata.remove(index);
log::info!("Texture {:?} is not tracked anymore", id,);
log::trace!("Texture {:?} is not tracked anymore", id,);
return true;
} else {
log::info!(
log::trace!(
"Texture {:?} is still referenced from {}",
id,
existing_ref_count
Expand Down

0 comments on commit ca4e131

Please sign in to comment.