Skip to content

Commit

Permalink
feat(log): remove log in release mode
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Oct 26, 2023
1 parent 0eecf4c commit ae07f60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion boards/stm32h7/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ mod app {

#[init]
fn init(cx: init::Context) -> (Shared, Local) {
rtt_logger::init(log::LevelFilter::Info);
if cfg!(debug_assertions) {
rtt_logger::init(log::LevelFilter::Info);
}

let cp = cx.core;
let dp = cx.device;

Expand Down
2 changes: 1 addition & 1 deletion rmk/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct KeyMapConfig {
/// Number of columns.
pub col: usize,
/// Number of layer
pub layer: usize
pub layer: usize,
}

/// KeyMap represents the stack of layers.
Expand Down
4 changes: 2 additions & 2 deletions rmk/src/usb.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use log::{error, info};
use log::error;
use usb_device::{
class_prelude::{UsbBus, UsbBusAllocator},
prelude::{UsbDevice, UsbDeviceBuilder, UsbVidPid},
Expand Down Expand Up @@ -132,7 +132,7 @@ impl<'a, B: UsbBus> KeyboardUsbDevice<'a, B> {
match self.consumer_control_hid.push_input(report) {
Ok(_) => (),
Err(UsbError::WouldBlock) => (),
Err(e) => info!("Send consumer control report error: {:?}", e),
Err(e) => error!("Send consumer control report error: {:?}", e),
}
}

Expand Down

0 comments on commit ae07f60

Please sign in to comment.