cclog日志在eclipse移植android时候不打印日志

今天cocos2dx项目完成做真机测试,并需要一些调试


悲催的华为手机(华为C8813 ,刚买的,亏死了)居然不支持对cclog日志在eclipse打印,以后如果有其他同学遇到这个问题不要再


纠结了。可能需要怎么设置,但是我还是没有找到。浪费了我一天的时间了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import csv import glob import os path = "D:\cclog\cclog" class StartUpTimeAnalysis: def init(self,fn): ext = os.path.splitext(fn)[-1].lower() if ext == '.xml': # self.root = etree.parse(fn) self.prepare_xml() else: with open(fn,'r') as fin: self.text = fin.read() # for line in fin: # if '[START UP TIMING]' in line: # # self.text += '\n%s' % line # self.text += line self.prepare_log() def prepare_xml(self): data = {} _app_init_done_delay = self.app_init_done_delay.split(" ")[-4] _graph_init_done_delay = self.graph_init_done_delay.split(" ")[-4] _render_frame_done_delay = self.render_frame_done_delay.split(" ")[-5] data["_app_init_done_delay"] = _app_init_done_delay data["_graph_init_done_delay"] = _graph_init_done_delay data["_render_frame_done_delay"] = _render_frame_done_delay return data def prepare_log(self): raw = self.text self.app_init_done_delay = '\n'.join( [el for el in raw.split('\n') if 'after appInit @' in el]) self.graph_init_done_delay = '\n'.join( [el for el in raw.split('\n') if 'avm graph init done' in el]) self.render_frame_done_delay = '\n'.join([el for el in raw.split('\n') if 'cc_render_renderFrame num:0' in el]) if name == 'main': line = ['index','LOG_FILE_NAME', 'APP_INIT_DONE_DELAY', 'GRAPH_INIT_DONE_DELAY', 'RENDER_FRAME_DONE_DELAY'] resultFilePath = os.path.join(path, "result_cold_start_time.csv") fout = open(resultFilePath, 'w', newline='') book = csv.writer(fout) book.writerow(line) print(os.path.join(path + '/**/VisualApp.localhost.root.log.ERROR*')) app_init_done_delay = [] graph_init_done_delay = [] render_frame_done_delay = [] for file_name in glob.glob(os.path.join(path + '/**/VisualApp.localhost.root.log.ERROR*')): res = {} index = os.path.dirname(file_name).split("\\")[-1] res['INDEX'] = index res['LOG_FILE_NAME'] = "VisualApp.localhost.root.log.ERROR_" + index st = StartUpTimeAnalysis(file_name) data = st.prepare_xml() res.update(data) app_init_done_delay.append(float(res["_app_init_done_delay"])) graph_init_done_delay.append(float(res["_graph_init_done_delay"])) render_frame_done_delay.append(float(res["_render_frame_done_delay"])) values = res.values() book.writerow(values) DA_MAX = ['', "MAX_VALUE", max(app_init_done_delay), max(graph_init_done_delay), max(render_frame_done_delay)] DA_MIN = ['', "MIN_VALUE", min(app_init_done_delay), min(graph_init_done_delay), min(render_frame_done_delay)] DA_AVG = ['', "AVG_VALUE", sum(app_init_done_delay)/len(app_init_done_delay), sum(graph_init_done_delay)/len(graph_init_done_delay), sum(render_frame_done_delay)/len(render_frame_done_delay)] book.writerow(DA_MAX) book.writerow(DA_MIN) book.writerow(DA_AVG) fout.close() 解释一下每行代码的意思
最新发布
07-15

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值