Add deafen controls

This commit is contained in:
Mikayla Maki 2023-06-20 12:34:32 -07:00
parent e58f0ac72f
commit b828a74ad6
No known key found for this signature in database
7 changed files with 197 additions and 65 deletions

View file

@ -12,7 +12,7 @@ use std::{
sync::Arc,
task::{Context, Poll},
thread,
time::Duration,
time::Duration, panic::Location,
};
use crate::{
@ -965,10 +965,12 @@ impl<T> Task<T> {
}
impl<T: 'static, E: 'static + Display> Task<Result<T, E>> {
#[track_caller]
pub fn detach_and_log_err(self, cx: &mut AppContext) {
cx.spawn(|_| async move {
if let Err(err) = self.await {
log::error!("{:#}", err);
let caller = Location::caller();
log::error!("{}:{}: {:#}", caller.file(), caller.line(), err);
}
})
.detach();