Skip to main content

A tool of logcat monitor

Project description


This is a tool class for use cases to find exception information in logcat in real time


1. Import

from logcat_monitor.logcat_monitor import LogcatMonitor

2. Start

logcat_monitor = LogcatMonitor(serial_number, parent_folder, key_dict, rows)

LogcatMonitor parameters:

serial_number: Serial number of the device, If only one device is connected, it can be set to None
parent_folder: The directory where the file is stored. In this directory, a directory named "logcats" will be created
key_dict: Keyword dictionary to find.
{"ANR in ": "Anr",
 "signal 6": "Signal6",
 "signal 7": "Signal7",
 "signal 11": "Signal11",
 "CRASH: ": "Crash",
 "Force Closed": "ForceClose"}
In dictionary, "Key" is keyword to find. "Value" must conform to Python's variable naming rules.
After finding the corresponding problem, a file named "Value_%Y%m%d%H%M%S%f.txt" will be generated.
rows: After finding the problem, intercept the number of lines of logcat. Default is 100.

3. Stop


After stopping monitoring, a file named "statistics.txt" will be generated.


if __name__ == '__main__':
    # Monitor logcat in real time
    logcat_monitor = LogcatMonitor(main_device.serial_number, parent_folder, key_dict={"E/ActivityManager": "Test"}, rows=50)

if __name__ == '__main__':
    # Filter existing logcat files
    logcat_monitor = LogcatMonitor()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logcat_monitor-0.0.25.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

logcat_monitor-0.0.25-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page