快速的自测
来源:互联网 发布:sql中dateadd 编辑:程序博客网 时间:2024/06/07 22:19
开发时候经常需要知道某个函数信息及执行时间等。
为了知道。我们经常添加很多变量之类。打印出消息。
显得代码不够简洁,也很麻烦。
现在找到个开源的项目,提供给大家参考下。
打印信息仅在debug模式生效。
HUGO--打印函数信息及执行时间的工具
项目地址:https://github.com/JakeWharton/hugo
Hugo
只需要在你的方法上加多@Debug,一切信息直接打印。
@DebugLogpublic String getName(String first, String last) { SystemClock.sleep(15); // Don't ever really do this! return first + " " + last;}
D/Example: ⇢ getName(first="Jake", last="Wharton")D/Example: ⇠ getName [16ms] = "Jake Wharton"
The logging will only happen in debug builds and the annotation itself is never present in the compiled class file for any build type. This means you can keep the annotation and check it into source control.
不是调试状态下,毫无影响。 赶紧加到你的项目中去吧。
Add it to your project today!
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.jakewharton.hugo:hugo-plugin:1.1.0' }}apply plugin: 'com.android.application'apply plugin: 'com.jakewharton.hugo'
0 0
- 快速的自测
- 开发的自测宝典
- 方便自测的东西
- 开发自测的原则
- 构建理想的模块自测结构
- 构建理想的模块自测结构
- 编程规范(自测的重要性)
- 自测kof2002的隐藏大招
- 改变线程优先级的自测小程序
- 开发自测?开发与测试的战争
- rdlc控件数据库图片的显示 自测成功!
- 自测服务器是否能够连接邮件服务器的方法
- 自测一下你的Java掌握得怎么样?
- 自测一下你的Java掌握得怎么样?
- 自测一下你的Java掌握得怎么样
- 自测一下你的Java掌握得怎么样?
- 自测一下你的Java掌握得怎么样?(转)
- 自测一下你的Java掌握得怎么样? .
- ExecutorService 创建线程池
- JavaFX的同一个HBox下拖动下拉条左侧按钮乱跳动的问题?
- js中将两个日期字符串相减
- UVa11021 Tribles
- Android广播事件机制及应用(实现简单的定时提醒功能)
- 快速的自测
- 三种工厂模式
- Unity3d测试记录和学习资料汇总
- RequestDispatcher.forward() 与 HttpServletResponse.sendRedirect()的区别
- 如何进行Monkey Test
- Linux网络编程(2):UDP客户服务程序设计
- 概率图模型基础
- Mac OS使用技巧之十一:隐藏launchpad中图标的方法
- android sd卡路径正确获取 双sd卡获取