<commit_before>import logging
import logging.handlers

class EximHandler(logging.Handler):
    """
    A handler class which sends an SMTP email for each logging event.
    """
    def __init__(self, toaddr, subject):
        """
        Initialize the handler.
        """
        logging.Handler.__init__(self)
        self.toaddr = toaddr
        self.subject = subject

    def getSubject(self, record):
        """
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        """
        return self.subject

    def emit(self, record):
        """
        Emit a record.

        Format the record and send it to the specified addressees.
        """
        try:
            from subprocess import Popen, PIPE

            msg = self.format(record)

            p1 = Popen(["echo", "-e", "Subject: " + self.subject + "\n\n" + msg], stdout=PIPE)
            p2 = Popen(["/usr/sbin/exim", "-odf", "-i", "<EMAIL>"], stdin=p1.stdout, stdout=PIPE)
            p1.stdout.close()  # Allow p1 to receive a SIGPIPE if p2 exits.
            output = p2.communicate()[0]

        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
 <commit_msg>Fix eximhandler to use the actual to addr<commit_after>import logging
import logging.handlers


class EximHandler(logging.Handler):
    """
    A handler class which sends an SMTP email for each logging event.
    """
    def __init__(self, toaddr, subject):
        """
        Initialize the handler.
        """
        logging.Handler.__init__(self)
        self.toaddr = toaddr
        self.subject = subject

    def getSubject(self, record):
        """
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        """
        return self.subject

    def emit(self, record):
        """
        Emit a record.

        Format the record and send it to the specified addressees.
        """
        try:
            from subprocess import Popen, PIPE

            msg = self.format(record)

            p1 = Popen(["echo", "-e", "Subject: " + self.subject + "\n\n" + msg], stdout=PIPE)
            p2 = Popen(["/usr/sbin/exim", "-odf", "-i", self.toaddr], stdin=p1.stdout, stdout=PIPE)
            p1.stdout.close()  # Allow p1 to receive a SIGPIPE if p2 exits.
            output = p2.communicate()[0]

        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
{'fraction_non_alphanumeric': 0.10644792064097673, 'fraction_numerical': 0.006104540251812286, 'mean_word_length': 1.9328859060402686, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4959993', 'n_tokens_mistral': 750, 'n_tokens_neox': 732, 'n_words': 231}