To track a variable's value while the Crazyflie is running we use the built in logging feature. This consists of the Crazyflie sending the table of contents of logging variables to the ground station, the ground station responds with what values it would like to receive. The Crazyflie then periodically sends those values to the ground station. Note the logging bandwidth is limited to 26 bytes so only a handful of values can be logged simultaneously.
# Firmware Setup
The variables that can be logged are determined at compile time and is setup through a C macro. These macros are defined under the [`src/modules/interface/log.h`](/../blob/master/crazyflie_software/crazyflie-firmware-2021%2E06/src/modules/interface/log%2Eh) file so be sure this is included where you want to use logging. These logging macros are typically placed at the end of the relevant .c file outside of any function definition. They read the value of static global variables.
The variables that can be logged are determined at compile time and are setup through a C macro. These macros are defined under the [`src/modules/interface/log.h`](/../blob/master/crazyflie_software/crazyflie-firmware-2021%2E06/src/modules/interface/log%2Eh) file so be sure this is included where you want to use logging. These logging macros are typically placed at the end of the relevant .c file outside of any function definition. They read the value of static global variables.
A logging variable is defined by its logging group and it's name, with the naming convention `group.name`. If you would like to log the _roll_ variable in the _stabilizer_ group it's access by _stabilizer.roll_.