fn log(&self, level: rdkafka::config::RDKafkaLogLevel, fac: &str, log_message: &str) {
        use rdkafka::config::RDKafkaLogLevel::*;
        match level {
            Emerg | Alert | Critical | Error => {
                let mut error = self.error.lock().expect("lock poisoned");
                // Do not allow logging to overwrite other values if
                // present.
                if error.is_none() {
                    *error = Some(log_message.to_string());
                }
                error!(target: "librdkafka", "{} {}", fac, log_message);
            }
            Warning => warn!(target: "librdkafka", "{} {}", fac, log_message),
            Notice => info!(target: "librdkafka", "{} {}", fac, log_message),
            Info => info!(target: "librdkafka", "{} {}", fac, log_message),
            Debug => debug!(target: "librdkafka", "{} {}", fac, log_message),
        }
    }
// `librdkafka` doesn't seem to propagate all Kerberos errors up the stack,
// but does log them, so we are currently relying on the `log` callback for
// error handling in situations we're aware of, e.g. cannot log into
// Kerberos.
`librdkafka` doesn't seem to propagate all Kerberos errors up the stack,
but does log them, so we are currently relying on the `log` callback for
error handling in situations we're aware of, e.g. cannot log into
Kerberos.
` librdkafka ` doesn ' t seem to propagate all Kerberos errors up the stack but does log them so we are currently relying on the ` log ` callback for error handling in situations we ' re aware of e . g . cannot log into Kerberos .
fn log(&self, level: rdkafka::config::RDKafkaLogLevel, fac: &str, log_message: &str) {
        use rdkafka::config::RDKafkaLogLevel::*;
        match level {
            Emerg | Alert | Critical | Error => {
                let mut error = self.error.lock().expect("lock poisoned");
                // Do not allow logging to overwrite other values if
                // present.
                if error.is_none() {
                    *error = Some(log_message.to_string());
                }
                error!(target: "librdkafka", "{} {}", fac, log_message);
            }
            Warning => warn!(target: "librdkafka", "{} {}", fac, log_message),
            Notice => info!(target: "librdkafka", "{} {}", fac, log_message),
            Info => info!(target: "librdkafka", "{} {}", fac, log_message),
            Debug => debug!(target: "librdkafka", "{} {}", fac, log_message),
        }
    }
fn log ( & self , level : rdkafka :: config :: RDKafkaLogLevel , fac : & str , log_message : & str ) { use rdkafka :: config :: RDKafkaLogLevel :: * ; match level { Emerg | Alert | Critical | Error => { let mut error = self . error . lock ( ) . expect ( " " ) ; // Do not allow logging to overwrite other values if // present. if error . is_none ( ) { * error = Some ( log_message . to_string ( ) ) ; } error ! ( target " " " " fac log_message ) ; } Warning => warn ! ( target " " " " fac log_message ) , Notice => info ! ( target " " " " fac log_message ) , Info => info ! ( target " " " " fac log_message ) , Debug => debug ! ( target " " " " fac log_message ) , } }
`librdkafka` doesn't seem to propagate all Kerberos errors up the stack,
but does log them, so we are currently relying on the `log` callback for
error handling in situations we're aware of, e.g.
` librdkafka ` doesn ' t seem to propagate all Kerberos errors up the stack but does log them so we are currently relying on the ` log ` callback for error handling in situations we ' re aware of e . g .
&self
level
rdkafka::config::RDKafkaLogLevel
fac
&str
log_message
&str
&self
level
rdkafka::config::RDKafkaLogLevel
fac
&str
log_message
&str