beeware / briefcase

Tools to support converting a Python project into a standalone native application.
https://briefcase.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.5k stars 354 forks source link

ADB log tailing color output #1676

Closed rmartin16 closed 4 months ago

rmartin16 commented 4 months ago

Changes

image

Notes

PR Checklist:

rmartin16 commented 4 months ago

In all its glory in CI: https://github.com/beeware/briefcase/actions/runs/8181483777/job/22371536462?pr=1676#step:28:596

One thing I was considering is that there isn't any way to disable this...adb doesn't seem to respect NO_COLOR, at least. It might be possible to inspect if RIch disabled color...and do the same for adb logcat...

rmartin16 commented 4 months ago

I went ahead and added support to detect broader color usage so adb log tailing will use color conditionally.

I wanted the tests to actually confirm the assumptions I'm making about Rich...but Rich is evaluating many aspects of the environment to determine if colors should be enabled. Trying to mock all of them to deal with the permutations of environments in which tests can run start to really question if we're testing those assumptions....or just my ability to mock the hell out of Rich. So, I'll have to dumb down the tests to just verify the outcomes of those assumptions are implemented correctly.