菜鸟笔记7——调试方法,log
来源:互联网 发布:苹果手机修改游戏数据 编辑:程序博客网 时间:2024/05/22 03:40
logcat界面的打开:
eclipse->Window->Open Perspective->DDMS,好了能看到logcat了,在程序各处写的Log.e(TAG,"adfafewf");什么的都会在这里显示。我操他大爷找死我了
附录:DDMS 的全称是Dalvik Debug Monitor Service,是 Android 开发环境中的Dalvik虚拟机调试监控服务。它为我们提供例如:为测试设备截屏,针对特定的进程查看正在运行的线程以及堆信息、Logcat、广播状态信息、模拟电话呼叫、接收SMS、虚拟地理坐标等等。
API for sending log output.
Generally, use the Log.v() Log.d() Log.i() Log.w() and Log.e() methods.
The order in terms of verbosity, from least to most is ERROR, WARN, INFO, DEBUG, VERBOSE. Verbose should never be compiled into an application except during development. Debug logs are compiled in but stripped at runtime. Error, warning and info logs are always kept.
Tip: A good convention is to declare a TAG
constant in your class:
private static final String TAG = "MyActivity";
and use that in subsequent calls to the log methods.
Tip: Don't forget that when you make a call like
Log.v(TAG, "index=" + i);
public static int d (String tag, String msg)
Send a DEBUG
log message.
Parameters
今天的几个error log:
TAG为IsiCamera2Activity的Log产生于如下片段:
try { BufferedOutputStream bos = new BufferedOutputStream (new FileOutputStream(myCaptureFile)); /* 采用压缩转档方法 */ bm.compress(Bitmap.CompressFormat.JPEG, 80, bos); /* 调用flush()方法,更新BufferStream */ bos.flush(); /* 结束OutputStream */ bos.close(); /* 显示完图文件,立即重置相机,并关闭预览 */ resetCamera(); /* 再重新启动相机继续预览 */ initCamera(); } catch (Exception e) { Log.e(TAG, e.getMessage()); }
看来是onPictureTaken()下执行到照片存储的时候。出现了问题。悲剧。不知道怎么解决,留这里备忘。
删除掉照片存储的部分,不再抛出error.但是leaked memory和failed to set all parameters依然存在。继续查吧,struggle..
内存溢出?
- 菜鸟笔记7——调试方法,log
- Log的调试方法
- ANR错误 log 调试方法
- ruby调试打log方法
- Symbian调试——使用Log日志
- python打印log调试信息的方法
- Android调试驱动抓log的方法
- Android调试驱动抓log的方法
- Android调试驱动抓log的方法
- Android菜鸟笔记2-Activity生命周期与Log
- 菜鸟学习笔记——jQuery中.css(),.each(),.append(),.html()方法总结
- 菜鸟学习笔记——servlet
- cakephp菜鸟笔记——输入数据处理*
- docker菜鸟笔记——总结1
- 菜鸟笔记——MVP浅解
- MFC入门——菜鸟级笔记
- Linux菜鸟笔记——vim编辑器
- Cocos2d-X之菜鸟笔记—3
- 操作系统标识宏
- Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面
- 图灵C/C++图书阅读路线图
- Microsoft 神经网络算法(Analysis Services – 数据挖掘)
- C++各种基本问题
- 菜鸟笔记7——调试方法,log
- Android蓝牙扫描设备过程
- poj 1698(最大流)
- OpenSsh 连接 ssh2 的测试
- GRUB整体分析
- C++常用函数(续)
- 2011_08_31_转自看雪论坛...方便自己回忆.........
- 回车焦点跳到下一个TextBox。
- hdu 3905