Logging additional data

If I wanted to include other data members into the data flash logs, how do i go about adding them into the logs with the rest of the logged data?

Can I just hijack a variable in the log.ino file and have it grab a different value to log?

For example, if i don’t care about logging the yaw error, could I just pick a different variable to assign to error_yaw in this function?:

// Write an attitude packet. Total length : 10 bytes static void Log_Write_Attitude(void) { struct log_Attitude pkt = { LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG), time_ms : hal.scheduler->millis(), roll : (int16_t)ahrs.roll_sensor, pitch : (int16_t)ahrs.pitch_sensor, yaw : (uint16_t)ahrs.yaw_sensor, error_rp : (uint16_t)(ahrs.get_error_rp() * 100), error_yaw : (uint16_t)(ahrs.get_error_yaw() * 100) }; DataFlash.WriteBlock(&pkt, sizeof(pkt)); }

Also, what is the purpose of the should_log() function? I am confused what is going on with the mask bits.

I figured out the should_log code, but I am still confused on how to change the log data around. I really would like to be able to log my own packet of data, but I am having trouble getting this accomplished.