/// Send logs to [Coralogix](https://coralogix.com/) service.
/// May return error if there was a problem sending.
Send logs to [Coralogix] service.
May return error if there was a problem sending.
Send logs to [ Coralogix ] service . May return error if there was a problem sending .
async fn send(
        &self,
        sub: &'_ str,
        entries: Vec<LogEntry>,
    ) -> Result<(), Box<dyn std::error::Error>> {
        if !entries.is_empty() {
            let msg = CxLogMsg {
                subsystem_name: sub,
                log_entries: entries,
                private_key: &self.api_key,
                application_name: &self.application_name,
            };
            let resp = self
                .client
                .post(&self.endpoint)
                .json(&msg)
                .send()
                .await
                .map_err(|e| CxErr { msg: e.to_string() })?;
            check_status(resp)
                .await
                .map_err(|e| CxErr { msg: e.to_string() })?;
        }
        Ok(())
    }
async fn send ( & self , sub : & ' _ str , entries : Vec < LogEntry > , ) -> Result < ( ) , Box < dyn std :: error :: Error > > { if ! entries . is_empty ( ) { let msg = CxLogMsg { subsystem_name : sub , log_entries : entries , private_key : & self . api_key , application_name : & self . application_name , } ; let resp = self . client . post ( & self . endpoint ) . json ( & msg ) . send ( ) . await . map_err ( | e | CxErr { msg : e . to_string ( ) } ) ? ; check_status ( resp ) . await . map_err ( | e | CxErr { msg : e . to_string ( ) } ) ? ; } Ok ( ( ) ) }
Send logs to [Coralogix](https://coralogix.com/) service.
Send logs to [ Coralogix ] ( https : // coralogix . com / ) service .
&self
sub
&'_ str
entries
Vec<LogEntry>