mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2024-12-15 02:59:21 +00:00
Auto merge of #561 - pornel:logging, r=fitzgen
Run without logging feature The build was broken without default features
This commit is contained in:
commit
17275f8700
@ -1,12 +1,12 @@
|
||||
macro_rules! log {
|
||||
(target: $target:expr, $lvl:expr, $($arg)+) => {
|
||||
(target: $target:expr, $lvl:expr, $($arg:tt)+) => {
|
||||
let _ = $target;
|
||||
let _ = log!($lvl, $($arg)+);
|
||||
};
|
||||
($lvl:expr, $($arg:tt)+) => {
|
||||
($lvl:expr, $($arg:tt)+) => {{
|
||||
let _ = $lvl;
|
||||
let _ = format_args!($($arg)+);
|
||||
};
|
||||
}};
|
||||
}
|
||||
macro_rules! error {
|
||||
(target: $target:expr, $($arg:tt)*) => { log!($target, $($arg)*); };
|
||||
|
@ -1,6 +1,8 @@
|
||||
extern crate bindgen;
|
||||
#[cfg(feature="logging")]
|
||||
extern crate env_logger;
|
||||
#[macro_use]
|
||||
#[cfg(feature="logging")]
|
||||
extern crate log;
|
||||
extern crate clang_sys;
|
||||
extern crate clap;
|
||||
@ -10,10 +12,15 @@ use bindgen::clang_version;
|
||||
use std::env;
|
||||
use std::panic;
|
||||
|
||||
#[macro_use]
|
||||
#[cfg(not(feature="logging"))]
|
||||
mod log_stubs;
|
||||
|
||||
mod options;
|
||||
use options::builder_from_flags;
|
||||
|
||||
pub fn main() {
|
||||
#[cfg(feature="logging")]
|
||||
log::set_logger(|max_log_level| {
|
||||
use env_logger::Logger;
|
||||
let env_logger = Logger::new();
|
||||
|
Loading…
Reference in New Issue
Block a user