(para)
e为跳出的阈值
        return : log_list,log_num
e为跳出的阈值
        return : log_list,log_num
e为跳出的阈值 return : log_list log_num
def getLogsAndSave(para):
    '''
        e为跳出的阈值
        return : log_list,log_num
    '''

    path = para['data_path']
    output_name = para['template_path']
    fre_word_path = para['fre_word_path']
    leaf_num = para['leaf_num']
    short_threshold = para['short_threshold']


    short_log=0
    n = 0
    log_once_list = []
    flag = 0
    wft = WordsFrequencyTree()
    # print path,date
    lft = LogFormatter()
    with open(path) as IN:
        n = 1
        for log in IN:
            n += 1
            log = log.strip()
            if not log:
                continue
            return_msg=getMsgFromNewSyslog(log)
            
            if len(return_msg[1]) < short_threshold: #过滤长度小于5的日志
                short_log+=1
                continue
            log_once_list.append(getMsgFromNewSyslog(log))

    print ('creating template')
    # print len(log_once_list)
    wft.do(log_once_list, para)
    print ('filting # short logs:',short_log,'| threshold =',short_threshold)
    print ('template_path:', output_name)
    print ('fre_word_path:', fre_word_path)
def getLogsAndSave ( para ) : path = para [ 'data_path' ] output_name = para [ 'template_path' ] fre_word_path = para [ 'fre_word_path' ] leaf_num = para [ 'leaf_num' ] short_threshold = para [ 'short_threshold' ] short_log = 0 n = 0 log_once_list = [ ] flag = 0 wft = WordsFrequencyTree ( ) # print path,date lft = LogFormatter ( ) with open ( path ) as IN : n = 1 for log in IN : n += 1 log = log . strip ( ) if not log : continue return_msg = getMsgFromNewSyslog ( log ) if len ( return_msg [ 1 ] ) < short_threshold : #过滤长度小于5的日志 short_log += 1 continue log_once_list . append ( getMsgFromNewSyslog ( log ) ) print ( 'creating template' ) # print len(log_once_list) wft . do ( log_once_list , para ) print ( 'filting # short logs:' , short_log , '| threshold =' , short_threshold ) print ( 'template_path:' , output_name ) print ( 'fre_word_path:' , fre_word_path )