บันทึก

public final class Log
extends Object

java.lang.Object
   ↳ com.android.tradefed.log.Log


คลาสบันทึกที่มิเรอร์ API ในแหล่งที่มาหลักของ Android

ลักษณะการทำงานเริ่มต้นจะแสดงผลบันทึกไปยัง System.out ใช้ setLogOutput(com.android.tradefed.log.Log.ILogOutput) เพื่อเปลี่ยนเส้นทางบันทึกไปที่อื่น

สรุป

ชั้นเรียนที่ซ้อนกัน

interface Log.ILogOutput

คลาสที่ใช้อินเทอร์เฟซนี้จะจัดเตรียมเมธอดที่จัดการกับการแสดงผลข้อความบันทึก 

เมธอดสาธารณะ

static void d(String tag, String message)

แสดงผลข้อความระดับ LogLevel.DEBUG

static void e(String tag, String message)

แสดงผลข้อความระดับ LogLevel.ERROR

static void e(String tag, Throwable throwable)

แสดงข้อมูลLogLevel.ERROR ระดับ Throwable

static String getLogFormatString(Log.LogLevel logLevel, String tag, String message)

จัดรูปแบบข้อความบันทึก

static void i(String tag, String message)

แสดงผลข้อความระดับ LogLevel.INFO

static void logAndDisplay(Log.LogLevel logLevel, String tag, String message)

แสดงผลข้อความบันทึกและพยายามแสดงในกล่องโต้ตอบ

static void printLog(Log.LogLevel logLevel, String tag, String message)

พิมพ์ข้อความบันทึก

static void setLogOutput(Log.ILogOutput logOutput)

ตั้งค่า ILogOutput ที่จะใช้ในการพิมพ์บันทึก

static void v(String tag, String message)

แสดงผลข้อความระดับ LogLevel.VERBOSE

static void w(String tag, String message)

แสดงผลข้อความระดับ LogLevel.WARN

เมธอดสาธารณะ

d

public static void d (String tag, 
                String message)

แสดงผลข้อความระดับ LogLevel.DEBUG

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง

e

public static void e (String tag, 
                String message)

แสดงผลข้อความระดับ LogLevel.ERROR

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง

e

public static void e (String tag, 
                Throwable throwable)

แสดงข้อมูลLogLevel.ERROR ระดับ Throwable

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

throwable Throwable: Throwable สำหรับเอาต์พุต

getLogFormatString

public static String getLogFormatString (Log.LogLevel logLevel, 
                String tag, 
                String message)

จัดรูปแบบข้อความบันทึก

คิกรีเทิร์น
String

i

public static void i (String tag, 
                String message)

แสดงผลข้อความระดับ LogLevel.INFO

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง

logAndDisplay

public static void logAndDisplay (Log.LogLevel logLevel, 
                String tag, 
                String message)

แสดงผลข้อความบันทึกและพยายามแสดงในกล่องโต้ตอบ

พารามิเตอร์
logLevel Log.LogLevel

tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง

printLog

public static void printLog (Log.LogLevel logLevel, 
                String tag, 
                String message)

พิมพ์ข้อความบันทึก

setLogOutput

public static void setLogOutput (Log.ILogOutput logOutput)

ตั้งค่า ILogOutput ที่จะใช้ในการพิมพ์บันทึก หากไม่ได้ตั้งค่า ระบบจะใช้ System.out

พารามิเตอร์
logOutput Log.ILogOutput: ILogOutput ที่จะใช้ในการพิมพ์บันทึก

v

public static void v (String tag, 
                String message)

แสดงผลข้อความระดับ LogLevel.VERBOSE

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง

w

public static void w (String tag, 
                String message)

แสดงผลข้อความระดับ LogLevel.WARN

พารามิเตอร์
tag String: แท็กที่เชื่อมโยงกับข้อความ

message String: ข้อความที่จะแสดง