(log_path, log_name, num)
| 39 | return log_file |
| 40 | |
| 41 | def _del_surplus_log(log_path, log_name, num): |
| 42 | history_log_path = log_path + '/history_logs' |
| 43 | logs=sorted(glob.glob(history_log_path + '/' + log_name + "*_log.log")) |
| 44 | |
| 45 | count=len(logs) |
| 46 | if count > num: |
| 47 | for i in logs[:count-num]: |
| 48 | if os.path.exists(i): |
| 49 | os.remove(i) |
| 50 | print('|---多余日志['+i+']已删除!') |
| 51 | |
| 52 | |
| 53 |
no test coverage detected