コード例 #1
0
ファイル: amount_calculator.py プロジェクト: ulei0343/huazhen
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)
    )
コード例 #2
0
ファイル: mysql_conn.py プロジェクト: FashtimeDotCom/huazhen
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
コード例 #3
0
ファイル: mysql_conn.py プロジェクト: moutainhigh/huazhen
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
コード例 #4
0
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))
コード例 #5
0
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))
コード例 #6
0
ファイル: nodify.py プロジェクト: moutainhigh/huazhen
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))
コード例 #7
0
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))
コード例 #8
0
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))
コード例 #9
0
ファイル: nodify.py プロジェクト: FashtimeDotCom/huazhen
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))
コード例 #10
0
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))