How can I periodically read the stacker log?

I would like to send an email by reading only the gcp application error log. However, previously read logs are not read. I want to use the cloud function (python). stackdriver How to search and read newspapers
I want to know.