def __write_err(content, func="main"): my_logger.write_err(content, "amount_calculator", func) mail_sender.send_alerting( """module:%s function:%s content:%s""" % ("amount_calculator", func, content) )
def get_conn(config): conn=None try: conn=mysql.connector.connect(**config) except mysql.connector.Error as e: my_logger.write_err('connect fails!{}'.format(e),"mysql_conn","get_conn") mail_sender.send_alerting('''module:%s function:%s content:%s''' %('mysql_conn',"get_conn",'connect fails!{}'.format(e))) conn=None return conn
def get_conn(config): conn = None try: conn = mysql.connector.connect(**config) except mysql.connector.Error as e: my_logger.write_err('connect fails!{}'.format(e), "mysql_conn", "get_conn") mail_sender.send_alerting( '''module:%s function:%s content:%s''' % ('mysql_conn', "get_conn", 'connect fails!{}'.format(e))) conn = None return conn
def __write_err(content,func='main'): my_logger.write_err(content,"product_status_changer",func) mail_sender.send_alerting('''module:%s function:%s content:%s''' %('product_status_changer',func,content))
def __write_err(content, func='main'): my_logger.write_err(content, "report_generator", func) mail_sender.send_alerting('''module:%s function:%s content:%s''' % ('report_generator', func, content))
def __write_err(content, func='main'): my_logger.write_err(content, "notify", func) mail_sender.send_alerting('''module:%s function:%s content:%s''' % ('notify', func, content))
def __write_err(content,func='main'): my_logger.write_err(content,"report_generator",func) mail_sender.send_alerting('''module:%s function:%s content:%s''' %('report_generator',func,content))
def __write_err(content,func='main'): my_logger.write_err(content,"amount_calculator",func) mail_sender.send_alerting('''module:%s function:%s content:%s''' %('amount_calculator',func,content))
def __write_err(content,func='main'): my_logger.write_err(content,"notify",func) mail_sender.send_alerting('''module:%s function:%s content:%s''' %('notify',func,content))
def __write_err(content, func='main'): my_logger.write_err(content, "product_status_changer", func) mail_sender.send_alerting('''module:%s function:%s content:%s''' % ('product_status_changer', func, content))