Merge pull request #1552 from embassy-rs/log-fix

usb-logger: fix breakage in log 0.4.19
This commit is contained in:
Dario Nieuwenhuis 2023-06-12 16:06:50 +00:00 committed by GitHub
commit c5a0e8579a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,7 @@ macro_rules! run {
( $x:expr, $l:expr, $p:ident ) => { ( $x:expr, $l:expr, $p:ident ) => {
static LOGGER: ::embassy_usb_logger::UsbLogger<$x> = ::embassy_usb_logger::UsbLogger::new(); static LOGGER: ::embassy_usb_logger::UsbLogger<$x> = ::embassy_usb_logger::UsbLogger::new();
unsafe { unsafe {
let _ = ::log::set_logger_racy(&LOGGER).map(|()| log::set_max_level($l)); let _ = ::log::set_logger_racy(&LOGGER).map(|()| log::set_max_level_racy($l));
} }
let _ = LOGGER.run(&mut ::embassy_usb_logger::LoggerState::new(), $p).await; let _ = LOGGER.run(&mut ::embassy_usb_logger::LoggerState::new(), $p).await;
}; };