We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我是页眉
[正则匹配链接[]()语法上有局限性 , 如有疑虑可查看本文原文](https://github.com/TomGarden/tom-notes/blob/master/_posts/Collections/Android/Android_API_DOC/2018-08-09- android.util.Log.md)
[]()
目录
java.lang.Object ↳ android.util.Log
API 用于打印日志。
通常一应该是用 Log.v(),log.d(),log.w(),log.e 和 log.e() 方法写日志。然后你可以在 Logcat 查看日志。
Log.v(),log.d(),log.w(),log.e 和 log.e()
日志的优先级顺序为:
除非在开发期间Verbose(详细信息)永远不应该编译到应用中。Debug日志在运行的应用中应该被除去。ERROR/WARNING应该永远保留在应用中。
提示:在应用中声明 TAG 是一个不错的实践,声明之后用该 TAG 作为参数调用日志方法。
//声明 private static final String TAG = "MyActivity"; //调用 Log.v(TAG, "index=" + i);
当你构建的字符串传递到 Log.d,编译器使用一个 StringBuilder 至少发生三次分配:StringBuilder 本身,缓冲区,String 对象。实际上还有另一次缓冲分配和复制,对于 GC 的压力更大。就是说,如果你的日志消息被过滤掉,将Android系统将做大量工作并产生大量开销。
我是页脚
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我是页眉
layout: post
title: null
date: 2018-08-09 14:25:03 +0800
categories: jekyll update
author: Tom
目录
{:toc}
android.util.Log
API 用于打印日志。
通常一应该是用
Log.v(),log.d(),log.w(),log.e 和 log.e()
方法写日志。然后你可以在 Logcat 查看日志。日志的优先级顺序为:
除非在开发期间Verbose(详细信息)永远不应该编译到应用中。Debug日志在运行的应用中应该被除去。ERROR/WARNING应该永远保留在应用中。
提示:在应用中声明 TAG 是一个不错的实践,声明之后用该 TAG 作为参数调用日志方法。
当你构建的字符串传递到 Log.d,编译器使用一个 StringBuilder 至少发生三次分配:StringBuilder 本身,缓冲区,String 对象。实际上还有另一次缓冲分配和复制,对于 GC 的压力更大。就是说,如果你的日志消息被过滤掉,将Android系统将做大量工作并产生大量开销。
我是页脚
The text was updated successfully, but these errors were encountered: