/// Redirect grpc log to rust's log implementation.
Redirect grpc log to rust's log implementation.
Redirect grpc log to rust ' s log implementation .
pub fn redirect_log() {
    let level = match log::max_level() {
        LevelFilter::Off => unsafe {
            // disable log.
            grpc_sys::gpr_set_log_function(None);
            return;
        },
        LevelFilter::Error | LevelFilter::Warn => GprLogSeverity::Error,
        LevelFilter::Info => GprLogSeverity::Info,
        LevelFilter::Debug | LevelFilter::Trace => GprLogSeverity::Debug,
    };
    unsafe {
        grpc_sys::gpr_set_log_verbosity(level);
        grpc_sys::gpr_set_log_function(Some(delegate));
    }
}
pub fn redirect_log ( ) { let level = match log :: max_level ( ) { LevelFilter :: Off => unsafe { // disable log. grpc_sys :: gpr_set_log_function ( None ) ; return ; } , LevelFilter :: Error | LevelFilter :: Warn => GprLogSeverity :: Error , LevelFilter :: Info => GprLogSeverity :: Info , LevelFilter :: Debug | LevelFilter :: Trace => GprLogSeverity :: Debug , } ; unsafe { grpc_sys :: gpr_set_log_verbosity ( level ) ; grpc_sys :: gpr_set_log_function ( Some ( delegate ) ) ; } }
Redirect grpc log to rust's log implementation.
Redirect grpc log to rust ' s log implementation .