Skip to content

Commit

Permalink
Only log from emailtunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortal committed Jul 30, 2017
1 parent c37da23 commit 4cfce69
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tutormail/__main__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import os
import sys
import six
import logging
import argparse
import asyncore

from emailtunnel import logger


def configure_logging():
root = logging.getLogger()
file_handler = logging.FileHandler('tutormail.log', 'a')
stream_handler = logging.StreamHandler(None)
fmt = '[%(asctime)s %(levelname)s] %(message)s'
datefmt = None
if six.PY3:
formatter = logging.Formatter(fmt, datefmt, '%')
else:
formatter = logging.Formatter(fmt, datefmt)
formatter = logging.Formatter(fmt, datefmt, '%')
for handler in (file_handler, stream_handler):
handler.setFormatter(formatter)
root.addHandler(handler)
root.setLevel(logging.DEBUG)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)


parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 4cfce69

Please sign in to comment.