Write programs that do one thing and do it well. ;)
And in the case it sends emails it couldn't send it directly to Gmail because of spam filters. So you must also provide a SMTP server with login credentials. And maybe you also would like to zip the log files before sending them via email.
Beside the option of a specific amount of time I also would provide a specific log file size.