SMTP_BUILD_ERROR = 'NOT SUCCESSFULL'
SMTP_FROM = '%s@profitbricks.com' %(pwd.getpwuid(os.geteuid()).pw_name)
-logger = logging.getLogger(sys.argv[0])
+#logger = logging.getLogger(sys.argv[0])
+#logger.setLevel(logging.DEBUG)
+#stream_handler = logging.StreamHandler()
+#stream_handler.setLevel(logging.DEBUG)
+#formatter = Formatter('%(asctime)s %(name)s[%(process)d] %(levelname)s: %(message)s')
+#stream_handler.setFormatter(formatter)
+#logger.addHandler(stream_handler)
+
+log_format = '%(asctime)s %(name)s[%(process)d] %(levelname)s: %(message)s'
+formatter = Formatter(log_format)
+logging.basicConfig(
+ format=log_format,
+ level=logging.DEBUG
+)
+logger = logging.getLogger(__file__)
logger.setLevel(logging.DEBUG)
-stream_handler = logging.StreamHandler()
-stream_handler.setLevel(logging.DEBUG)
-formatter = Formatter('%(asctime)s %(name)s[%(process)d] %(levelname)s: %(message)s')
-stream_handler.setFormatter(formatter)
-logger.addHandler(stream_handler)
+#stream_handler = logging.StreamHandler()
+#stream_handler.setLevel(logging.DEBUG)
+#stream_handler.setFormatter(formatter)
+#logger.addHandler(stream_handler)
def send_email(result):
smtp = smtplib.SMTP(SMTP_SERVER)