void AP_Logger::WriteV(const char *name, const char *labels, const char *units, const char *mults, const char *fmt, va_list arg_list) { struct log_write_fmt *f = msg_fmt_for_name(name, labels, units, mults, fmt); if (f == nullptr) { // unable to map name to a messagetype; could be out of // msgtypes, could be out of slots, ... AP::internalerror().error(AP_InternalError::error_t::logger_mapfailure); return; } for (uint8_t i=0; i<_next_backend; i++) { if (!(f->sent_mask & (1U<<i))) { if (!backends[i]->Write_Emit_FMT(f->msg_type)) { continue; } f->sent_mask |= (1U<<i); } va_list arg_copy; va_copy(arg_copy, arg_list); backends[i]->Write(f->msg_type, arg_copy); va_end(arg_copy); } }
/* Log_Write support */ void DataFlash_Class::Log_Write(const char *name, const char *labels, const char *fmt, ...) { va_list arg_list; struct log_write_fmt *f = msg_fmt_for_name(name, labels, fmt); if (f == nullptr) { // unable to map name to a messagetype; could be out of // msgtypes, could be out of slots, ... internal_error(); return; } for (uint8_t i=0; i<_next_backend; i++) { if (!(f->sent_mask & (1U<<i))) { if (!backends[i]->Log_Write_Emit_FMT(f->msg_type)) { continue; } f->sent_mask |= (1U<<i); } va_start(arg_list, fmt); backends[i]->Log_Write(f->msg_type, arg_list); va_end(arg_list); } }