import com.android.ddmlib.Log.ILogOutput;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.AllocationPanel;
+import com.android.ddmuilib.DdmUiPreferences;
import com.android.ddmuilib.DevicePanel;
import com.android.ddmuilib.EmulatorControlPanel;
import com.android.ddmuilib.HeapPanel;
import com.android.ddmuilib.handler.BaseFileHandler;
import com.android.ddmuilib.handler.MethodProfilingHandler;
import com.android.ddmuilib.log.event.EventLogPanel;
+import com.android.ddmuilib.logcat.LogCatPanel;
+import com.android.ddmuilib.logcat.LogCatReceiver;
import com.android.ddmuilib.logcat.LogColors;
import com.android.ddmuilib.logcat.LogFilter;
import com.android.ddmuilib.logcat.LogPanel;
}
- private LogPanel mLogPanel;
+ /**
+ * Flag to indicate whether to use the old or the new logcat view. This is a
+ * temporary workaround that will be removed once the new view is complete.
+ */
+ private static final String USE_NEW_LOGCAT_VIEW =
+ System.getenv("ANDROID_USE_NEW_LOGCAT_VIEW");
+ private boolean useOldLogCatView() {
+ return USE_NEW_LOGCAT_VIEW == null;
+ }
+
+ private LogPanel mLogPanel; /* only valid when useOldLogCatView() == true */
+ private LogCatPanel mLogCatPanel; /* only valid when useOldLogCatView() == false */
private ToolItemAction mCreateFilterAction;
private ToolItemAction mDeleteFilterAction;
if (!mDisplay.readAndDispatch())
mDisplay.sleep();
}
- mLogPanel.stopLogCat(true);
+ if (useOldLogCatView()) {
+ mLogPanel.stopLogCat(true);
+ }
mDevicePanel.dispose();
for (TablePanel panel : mPanels) {
panelArea.setLayout(new FormLayout());
createTopPanel(topPanel, darkGray);
- createBottomPanel(bottomPanel);
+
+ if (useOldLogCatView()) {
+ createBottomPanel(bottomPanel);
+ } else {
+ createLogCatView(bottomPanel);
+ }
// form layout data
FormData data = new FormData();
mTableListener = new TableFocusListener();
// now set up the listener in the various panels
- mLogPanel.setTableFocusListener(mTableListener);
+ if (useOldLogCatView()) {
+ mLogPanel.setTableFocusListener(mTableListener);
+ }
mEventLogPanel.setTableFocusListener(mTableListener);
for (TablePanel p : mPanels) {
if (p != null) {
mLogPanel.startLogCat(mCurrentDevice);
}
+ private void createLogCatView(Composite parent) {
+ mLogCatPanel = new LogCatPanel(new LogCatReceiver(), DdmUiPreferences.getStore());
+ mLogCatPanel.createPanel(parent);
+
+ if (mCurrentDevice != null) {
+ mLogCatPanel.deviceSelected(mCurrentDevice);
+ }
+ }
+
/*
* Create the contents of the left panel: a table of VMs.
*/
}
mEmulatorPanel.deviceSelected(mCurrentDevice);
- mLogPanel.deviceSelected(mCurrentDevice);
+ if (useOldLogCatView()) {
+ mLogPanel.deviceSelected(mCurrentDevice);
+ } else {
+ mLogCatPanel.deviceSelected(mCurrentDevice);
+ }
if (mEventLogPanel != null) {
mEventLogPanel.deviceSelected(mCurrentDevice);
}