A tool of logcat monitor
Project description
Introduction
This is a tool class for use cases to find exception information in logcat in real time
#Usage
1. Import
from logcat_monitor.logcat_monitor import LogcatMonitor
2. Start
logcat_monitor = LogcatMonitor(serial_number, parent_folder, key_dict, rows)
logcat_monitor.start_monitor()
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",
"FATAL EXCEPTION:": "Fatal",
"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
logcat_monitor.stop_monitor()
After stopping monitoring, a file named "statistics.txt" will be generated.
Example
if __name__ == '__main__':
...
# Monitor logcat in real time
logcat_monitor = LogcatMonitor(main_device.serial_number, parent_folder, key_dict={"E/ActivityManager": "Test"}, rows=50)
logcat_monitor.start_monitor()
...
logcat_monitor.stop_monitor()
if __name__ == '__main__':
...
# Filter existing logcat files
logcat_monitor = LogcatMonitor()
logcat_monitor.filter_file("logcat.txt")
Project details
Release history Release notifications | RSS feed
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.19.tar.gz
(5.8 kB
view details)
Built Distribution
File details
Details for the file logcat_monitor-0.0.19.tar.gz
.
File metadata
- Download URL: logcat_monitor-0.0.19.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6161df339569a8e14d251eef6a46ce418a0440d7c43d176dfb40bd0ec466fd12 |
|
MD5 | b0b2f96b74a261a81effa13c84f4014c |
|
BLAKE2b-256 | 39d26c2bf140dfc897f7461f8086eaec662dc4c5607f00dcc2e9a3d3d8ef0cbc |
File details
Details for the file logcat_monitor-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: logcat_monitor-0.0.19-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23d57eb74932a5c1a20c2b81497af0e439cba42d83b25196427afba894e58fbe |
|
MD5 | a67a0326f59bc728d22398757d50a5f3 |
|
BLAKE2b-256 | 5e0d594e423ee38b747ab9360ff5906f92608ba79627853b59aa5c41b26ae9e1 |