Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adb: Use current date/time instead of last logcat line for timestamp #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarijnS95
Copy link
Member

We have some phones, including the Vivo X90 Pro which return an empty string for logcat -t 1, resulting in an unwrap() crash before starting logging. There doesn't appear to be any reason to check the time of the latest random (not even --uid-scoped) message in logcat as we can just read the current date and time as well. We haven't started the app yet either way, and this timestamp is inevitably already going to be later than the most recent message.

Also remove some unnecessary shell escaping (which should have been done by shlex otherwise) by calling adb logcat rather than adb shell logcat.

We have some phones, including the Vivo X90 Pro which return an empty
string for `logcat -t 1`, resulting in an `unwrap()` crash before
starting logging.  There doesn't appear to be any reason to check the
time of the latest **random** (not even `--uid`-scoped) message in
`logcat` as we can just read the current date and time as well.  We
haven't started the app yet either way, and this timestamp is inevitably
already going to be later than the most recent message.

Also remove some unnecessary shell escaping (which should have been done
by `shlex` otherwise) by calling `adb logcat` rather than `adb shell
logcat`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant