Logging with indicies (organizing logs)

Hi all,

I’m adding a decent amount of logged data to my dataflash logs, and I was wondering if anyone knows how to organize the logged data as an array (see attached). For example, I want to log the same information for each of my UAVCAN ESCs as ESCE[0], ESCE[1], ESCE[2], ESCE[3]. I’ve so far only used the AP::logger().Write(…) methods, but they require the first argument (name) to be unique and thus just overwrite each other when I attempt to log my ESCE array. Can someone explain how this is done in the ardupilot code for things like IMU[…], BAT[…], and other log messages that are indexed and organized nicely?

Screen Shot 2022-02-07 at 9.41.47 PM

They include the id field, that is marked with the special # symbol.