Log Temp & Other BME680 Data

Wondering if somebody could help me log BME680 data to a log. I can query the data using this macro:
[gcode_macro QUERY_ENVIRONMENT]
gcode:
{% set sensor = printer[“bme280 Enviro”] %}
{action_respond_info(
“Temperature: %.2f C\n”
“Pressure: %.2f hPa\n”
“Humidity: %.2f%%\n”
“Gas Level: %.2f VOC” % (
sensor.temperature,
sensor.pressure,
sensor.humidity,
sensor.gas_level))}

How can i set it to automatically read this at set interval and then record values in a log. Want to make some sense of the gas level sensor readings from it and be lot easier with more readings and log of them.

Thanks!

See delayed-gcodes