Skip to content

Feature/logcat#1

Merged
mabualzait merged 3 commits into
masterfrom
feature/logcat
Sep 18, 2025
Merged

Feature/logcat#1
mabualzait merged 3 commits into
masterfrom
feature/logcat

Conversation

@mabualzait

Copy link
Copy Markdown
Owner

No description provided.

… capabilities

- Updated LogsModule to support real-time log streaming with start/stop controls
- Implemented filtering by log level, tag, and search query
- Improved UI layout for log entries with additional PID display
- Added functionality to generate test logs in the sample app for demonstration
- Updated instructions in the main activity to include new log generation feature
- Introduced a main menu view for module selection and improved navigation
- Updated DebugOverlay to manage module display and interactions more effectively
- Added support for dynamic module updates with a dedicated adapter
- Refined layout parameters in module_logcat.xml for better usability and aesthetics
Copilot AI review requested due to automatic review settings September 18, 2025 07:48
@mabualzait mabualzait added the enhancement New feature or request label Sep 18, 2025
@mabualzait mabualzait merged commit a583783 into master Sep 18, 2025
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Logcat Viewer module to the debug drawer, providing real-time logcat streaming with advanced filtering and search capabilities. The module replaces the basic logs functionality with a comprehensive logging interface that includes level filtering, tag filtering, search, and live streaming controls.

  • Enhanced logcat viewing with real-time streaming, pause/resume, and filtering by log level, tag, and text search
  • Updated UI layouts with a new grid-based main menu and dedicated module view containers
  • Added test log generation functionality to the sample app for demonstration purposes

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sampleapp/src/main/res/layout/activity_main.xml Added "Generate Test Logs" button and updated instructions
sampleapp/src/main/java/com/abualzait/debugdrawer/sampleapp/MainActivity.kt Implemented test log generation functionality with various log levels and tags
debugdrawer/src/main/res/layout/module_logcat.xml New comprehensive logcat viewer layout with controls for streaming, filtering, and search
debugdrawer/src/main/res/layout/item_log.xml Redesigned log item layout with dark theme and monospace font
debugdrawer/src/main/res/layout/debug_module_view.xml New layout for individual module views with navigation header
debugdrawer/src/main/res/layout/debug_module_item.xml Grid item layout for module selection in main menu
debugdrawer/src/main/res/layout/debug_drawer_main_menu.xml New main menu layout with grid-based module selection
debugdrawer/src/main/res/drawable/debug_module_item_background.xml Background drawable for module grid items
debugdrawer/src/main/java/com/abualzait/debugdrawer/modules/LogsModule.kt Complete rewrite with real-time streaming, filtering, and enhanced functionality
debugdrawer/src/main/java/com/abualzait/debugdrawer/adapter/DebugModuleAdapter.kt New adapter for grid-based module selection
debugdrawer/src/main/java/com/abualzait/debugdrawer/DebugDrawer.kt Updated to support new grid-based navigation and module view system
.github/workflows/ci.yml Simplified CI workflow triggers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +159 to +182
executor.execute {
try {
logcatProcess = Runtime.getRuntime().exec("logcat -v time")
val reader = BufferedReader(InputStreamReader(logcatProcess?.inputStream))

reader.useLines { lines ->
lines.forEach { line ->
if (!isPaused) {
val logEntry = parseLogLine(line)
if (logEntry != null) {
mainHandler.post {
addLogEntry(logEntry)
}
}
}
}
}
} catch (e: Exception) {
logger.e("LogsModule", "Failed to stream logs", e)
mainHandler.post {
isStreaming = false
}
}
}

Copilot AI Sep 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The background thread execution could continue indefinitely if the logcat process doesn't terminate naturally. The isStreaming flag should be checked within the forEach loop to allow for clean interruption when streaming is stopped.

Copilot uses AI. Check for mistakes.
}

override fun onDetach() {
stopLogcatStreaming()

Copilot AI Sep 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The executor service should be properly shut down in the onDetach method to prevent resource leaks. Add executor.shutdown() after stopping logcat streaming.

Suggested change
stopLogcatStreaming()
stopLogcatStreaming()
executor.shutdown()

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants