debug output: ensure our debug output is captured on Android

I would have bet money that Android used to send stderr to the logcat
log, but apparently it doesn't (anymore?). So in order to be able to
have a chance to debug weird cloud storage issues on Android, let's do
some wholesale replacement of fprintf(stderr,...) with our own version
of the INFO macro that we long ago borrowed from libdivecomputer (and
rename it to ensure we don't have a conflict there).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-04-17 13:02:25 -07:00
parent 47506028ca
commit f9f4a9c232
8 changed files with 64 additions and 61 deletions

View file

@ -318,7 +318,7 @@ int get_cylinder_index(const struct dive *dive, const struct event *ev)
* We now match up gas change events with their cylinders at dive
* event fixup time.
*/
fprintf(stderr, "Still looking up cylinder based on gas mix in get_cylinder_index()!\n");
SSRF_INFO("Still looking up cylinder based on gas mix in get_cylinder_index()!\n");
mix = get_gasmix_from_event(dive, ev);
best = find_best_gasmix_match(mix, &dive->cylinders);
@ -1056,7 +1056,7 @@ void calculate_deco_information(struct deco_state *ds, const struct deco_state *
entry->ambpressure = depth_to_bar(entry->depth, dive);
entry->gfline = get_gf(ds, entry->ambpressure, dive) * (100.0 - AMB_PERCENTAGE) + AMB_PERCENTAGE;
if (t0 > t1) {
fprintf(stderr, "non-monotonous dive stamps %d %d\n", t0, t1);
SSRF_INFO("non-monotonous dive stamps %d %d\n", t0, t1);
int xchg = t1;
t1 = t0;
t0 = xchg;