Dima Anoshin
07/06/2023, 2:22 PMdef log_it():
logger = get_run_logger()
<http://logger.info|logger.info>("INFO level log message.")
logger.debug("You only see this message if the logging level is set to DEBUG. 🙂")
when we have a flow and we want to add logs, should logs be another flow or task?Emil Christensen
07/06/2023, 2:24 PMlogger
. They do not have to be separated out.@flow
or inside a function it calls, you can log from there.Dima Anoshin
07/06/2023, 2:30 PM@task(retries=4, retry_delay_seconds=0.1)
def save_weather(temp, windspeed, rain):
logger = get_run_logger()
<http://logger.info|logger.info>("Saving weather data...")
with open("weather.csv", "w+") as w:
w.write(str(temp) + ", " + str(windspeed) + ", " + str(rain) + "\n")
<http://logger.info|logger.info>("Weather data saved successfully.")
return "Successfully wrote temp, windspeed, and rain"
Emil Christensen
07/06/2023, 2:35 PM