查看与输出日志信息:
1.优先级级别从高到低: Error > Warning > Info > Debug > Verbose
2.日志输出的3种方式:
(1) Log.i
(2) System.out.println
(3) System.err.println
3.实践:
1 package com.example.test; 2 3 import android.test.AndroidTestCase; 4 import android.util.Log; 5 6 public class LogTest extends AndroidTestCase{ 7 8 private static final String TAG = "LogTest"; 9 10 public void testOutLog() throws Throwable{ 11 Log.i(TAG, "www.itcast.cn"); 12 } 13 14 public void testOutLog2() throws Throwable{ 15 System.out.println("www.itcast.cn"); 16 } 17 18 public void testOutLog3() throws Throwable{ 19 System.err.println("www.itcast.cn"); 20 } 21 }
时间: 2024-10-18 09:53:31