Add proper logging and dryrun

Adds arguments for --dryrun to avoid sending emails,
and changes print statements to use logging with appropriate
log levels