这个时候常用的android java文件打印log方法还无法使用,最后还是在google上找到了办法,再次记录下,给有用的同学
baopingx@horse:/out2/baopingx/64bitmaster/libcore/luni/src/main/java/java/io$ git diff
diff --git a/luni/src/main/java/java/io/FileInputStream.java b/luni/src/main/java/java/io/FileInputStream.java
import java.nio.NioUtils;
import libcore.io.IoBridge;
import libcore.io.Libcore;
import libcore.io.Streams;
+import java.util.logging.Logger;
import static android.system.OsConstants.*;
/**
@@ -74,7 +75,8 @@ public class FileInputStream extends InputStream {
throw new NullPointerException("file == null");
}
this.fd = IoBridge.open(file.getPath(), O_RDONLY);
- this.shouldClose = true;
+ Logger.global.info("wilson begin to get path"+file.getPath());
adb logcat
I/global ( 4660): wilson begin to get path/data/data/com.google.android.googlequicksearchbox/files/event_logger_buffer
可以去看下Logger.java
public static final Logger global = new Logger(GLOBAL_LOGGER_NAME, null);
public static final String GLOBAL_LOGGER_NAME = "global";
public void warning(String msg) {
log(Level.WARNING, msg);
}
public void info(String msg) {
log(Level.INFO, msg);
}
正常情况下我就用info,简单好用,主要是效果好.
阅读(3023) | 评论(0) | 转发(0) |