// 1. 標準 Java 輸出 (會被系統收集到 logcat)
System.out.println("Debug message");
// 2. Android 專用 Log 類 (推薦,支援標籤、等級、過濾)
import android.util.Log;
Log.d("MyTag", "Debug message"); // Debug
Log.i("MyTag", "Info message"); // Info
Log.w("MyTag", "Warning message"); // Warn
Log.e("MyTag", "Error message"); // Error
Log.v("MyTag", "Verbose"); // Verbose (最詳細)
Log.wtf("MyTag", "Terrible Failure"); // What a Terrible Failure


Log.d("MyTag", ...))

File → Import → Existing Projects into Workspace → 選擇專案根目錄 → Finish
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead.
解決:專案右鍵 → Android Tools → Fix Project Properties。
若無效:Properties → Java Compiler → 勾選 Enable project specific settings → Compiler compliance level 設 1.6 或 1.7 (視 targetSdkVersion)。
L.d(tag, msg) 內部判斷 BuildConfig.DEBUG,Release 版自動關閉。StrictMode.setThreadPolicy(...) 偵測主執行緒磁碟/網路 I/O。adb logcat -d > log.txt:導出完整日誌離線分析。