Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0d7ad74 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

btclient: Add print_error macro

Bug: 188718349
Tag: #floss
Test: Build floss on Linux

Change-Id: Ib584938043ab54d463040d5c75545cb6b7fc8cec
parent f93c7586
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -14,6 +14,13 @@ macro_rules! console_yellow {
    };
}

#[macro_export]
macro_rules! console_red {
    ( $text:expr ) => {
        format!("\x1b[1;31m{}\x1b[0m", $text).as_str()
    };
}

#[macro_export]
macro_rules! print_info {
    ( $($arg:tt)* ) => {
@@ -23,3 +30,13 @@ macro_rules! print_info {
        }
    };
}

#[macro_export]
macro_rules! print_error {
    ( $($arg:tt)* ) => {
        {
            print!("{}: ", console_red!("btclient:error"));
            println!($($arg)*);
        }
    };
}