mirfatif / MyLocation

Know your geo coordinates using on-device GPS and Network location providers
GNU Affero General Public License v3.0
64 stars 6 forks source link

Add logging #11

Open gdt opened 2 years ago

gdt commented 2 years ago

When using this as a debug tool, the dynamic behavior from startup is very interesting. For example I think I saw DejaVu first report cell-based location and then after wifi scan completed a better location.

Inspired by GPSTest, it would be nice to have a persistent setting for logs, and if set, then on each invocation a log file would be written to Downloads/MyLocation/yyyymmddThhmmss.json (UTC!) or something like that, and have records perhaps (in json but logically like): time=t event=start time=t event=location provider=foo lat=x lon=y hae=z accuracy=w time=t event=disable provider=gps time=t event=end

with the hope that some scripts in contrib could process this, but even humans reading it would be very useful.

Lee-Carre commented 2 years ago

a log file would be written to

A user-configurable directory, preferably.

JSON

Surely CSV would be a sensible format for such (rapid) logging of what may end up being a large amount of data.

yyyymmddThhmmss.json (UTC!)

Then you mean “YYYY(-)MM(-)DDTHHMMSSZ” (ISO 8601).

gdt commented 2 years ago

Sure, csv is fine too. I meant not a giant json object but 1 object per line, only because there are different types of events. Anything that's easy to parse is fine.