Skip to main content

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


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.24.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

logcat_monitor-0.0.24-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file logcat_monitor-0.0.24.tar.gz.

File metadata

  • Download URL: logcat_monitor-0.0.24.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for logcat_monitor-0.0.24.tar.gz
Algorithm Hash digest
SHA256 0fb1487a9a682fc919b058661c6375d55eca367f9a57b6f0a45f9dbe9110f7e1
MD5 7b6e3235c5217bf4108e34f1f3fba493
BLAKE2b-256 6b981760351b8d377e355b2f4b76c81a7afa6515d16d7b1ec94281465e0afdbd

See more details on using hashes here.

File details

Details for the file logcat_monitor-0.0.24-py3-none-any.whl.

File metadata

  • Download URL: logcat_monitor-0.0.24-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for logcat_monitor-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 cc3bb91a6e0f198f52f80126a19c709086bea00fdf42db70b86524781caf16df
MD5 4d4789e7bd51605f5347ab8b59c3c7a3
BLAKE2b-256 e12fc43430f78cd3fbf298ba11494a9eda91e5700eb6bc2399c88e8aa37ad0b5

See more details on using hashes here.

Supported by

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