https://github.com/JakeWharton/hugo

JakeWharton 大神的日志框架,用于 debug build 时显示方法的参数、返回值、运行时间。

用法

@DebugLog 注解添加到方法前即可。

@DebugLogpublic String getName(String first, String last) {  SystemClock.sleep(15); // Don't ever really do this!  return first + " " + last;}
V/Example: ⇢ getName(first="Jake", last="Wharton")V/Example: ⇠ getName [16ms] = "Jake Wharton"

打印日志只会在 debug builds 发生,注解也不会在任何编译后的 class 文件出现。完全不影响非 debug builds.

配置

Example

buildscript { repositories { mavenCentral() }  dependencies { classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1' }}apply plugin: 'com.android.application'apply plugin: 'com.jakewharton.hugo'

可以临时性禁用:

hugo {  enabled false}

也支持在运行时切换, use Hugo.setEnabled(true|false)

问题

运行时 java.lang.VerifyError 未找到解决方案,也好久没发新版本了,回头再看看吧。

更多相关文章

  1. Android应用开发中如何进行单元测试
  2. Android(安卓)RecyclerView:设置指定位置的两种方法
  3. android线程相关1
  4. android View的三个构造方法 简单总结
  5. Android抓包方法
  6. okhttp源码学习分析一
  7. Android开发经验总结
  8. Android倒计时实现
  9. android dialog 背景透明的样式

随机推荐

  1. MVVM实现数据双向绑定
  2. Android-Fragment
  3. Android中Activity组件的生命周期
  4. Cocos2d-x Mac下环境搭建
  5. Android(安卓)ionic工程中调用webrtc获取
  6. Android沉浸式状态栏设计的实例代码
  7. Android(安卓)音视频开发(五) -- 使用 Me
  8. Binder通信机制
  9. android-实现黑名单拦截
  10. GreenDao 问题集合