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

Add configurable log levels #123

Open
j005u opened this issue May 13, 2023 · 4 comments
Open

Add configurable log levels #123

j005u opened this issue May 13, 2023 · 4 comments

Comments

@j005u
Copy link
Contributor

j005u commented May 13, 2023

In order to help debugging user issues like osd recording not working or canvas size negotiation failing we should add configurable debug levels to msp-osd.

I imagine we want at least two levels (+ disabled) because anything that fires once per frame should probably be it's own level.

Ideally with a separate log file in /opt/var/log/msp-osd/msp-osd.log but we can also deal with printf via dmesg output worst case. We can add a dependency for logrotate (once added to the mirror repo) and a config file to make sure it never gets out of hand.

Specifically I'm trying to find out why kelso88#0828 from Discord can't get osd to record, even though the setup appears valid otherwise.

@j005u
Copy link
Contributor Author

j005u commented May 13, 2023

PS: there was earlier development on the configurator to allow exporting of package logs via the UI: fpv-wtf/wtfos-configurator#106

It was not shipped however.

@benlumley
Copy link
Collaborator

no disk space usage issues to worry about i presume; we have enough headroom there that it should be ok ?

I think as a start....

new log function
replace all toast calls with log calls on goggles
log can write to file; on goggles can also call toast as configured

and then sprinkle logging calls around all the init / negotiation type stuff

@j005u
Copy link
Contributor Author

j005u commented May 14, 2023

I have 2GB free on my V2 Goggles blackbox, so yeah, it should entirely be fine. We'll need to add logrotate or something similar for sure, otherwise eventually it'll still blow up. And definitely lets not default to any per frame logging (except maybe fatal errors I spose).

I'll take it upon myself to have logrotate available in the repo for a dep soon.

Makes sense to have all toasts logged, but I'd leave it to the maintainers to discuss how this makes sense. i.e. replace toast calls with logging calls with a flag to also show a toast, or have the toast function also call the log function.

I imagine we might want to dump more data to the log than necessarily show in the UI.

@j005u
Copy link
Contributor Author

j005u commented May 14, 2023

Actually, I wonder if it'd make sense to use the android log functions and DJI-s existing blackbox logger to write to disk and take care of rotation etc. I'll look into it shortly, my main concern is being able to distinguish msp-osd logs from general glasses logs in a clean way.

The upside would be the abilty to use existing adb logcat tools during dev. Including: https://yume-chan.github.io/ya-webadb/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

No branches or pull requests

2 participants