Implement mail_log function in rb.