summaryrefslogtreecommitdiffstats
path: root/core/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-17 13:02:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-18 09:00:21 -0700
commitf9f4a9c232357c3967394e8f6a64f9aa36430a45 (patch)
tree5a49489115fa788385daff5d42fe936231f352b7 /core/save-git.c
parent47506028ca81be864b4cf2f6b87b8e81d18052bc (diff)
downloadsubsurface-f9f4a9c232357c3967394e8f6a64f9aa36430a45.tar.gz
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>
Diffstat (limited to 'core/save-git.c')
-rw-r--r--core/save-git.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/save-git.c b/core/save-git.c
index 6f1cc4646..5de9c2a63 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -448,7 +448,7 @@ static void create_dive_buffer(struct dive *dive, struct membuffer *b)
if (dive->dive_site)
put_format(b, "divesiteid %08x\n", dive->dive_site->uuid);
if (verbose && dive->dive_site)
- fprintf(stderr, "removed reference to non-existant dive site with uuid %08x\n", dive->dive_site->uuid);
+ SSRF_INFO("removed reference to non-existant dive site with uuid %08x\n", dive->dive_site->uuid);
save_overview(b, dive);
save_cylinder_info(b, dive);
save_weightsystem_info(b, dive);
@@ -491,7 +491,7 @@ static int tree_insert(git_treebuilder *dir, const char *name, int mkunique, git
if (ret) {
const git_error *gerr = giterr_last();
if (gerr) {
- fprintf(stderr, "tree_insert failed with return %d error %s\n", ret, gerr->message);
+ SSRF_INFO("tree_insert failed with return %d error %s\n", ret, gerr->message);
}
}
return ret;
@@ -1071,7 +1071,7 @@ static void create_commit_message(struct membuffer *msg, bool create_empty)
free((void *)user_agent);
free(changes_made);
if (verbose)
- fprintf(stderr, "Commit message:\n\n%s\n", mb_cstring(msg));
+ SSRF_INFO("Commit message:\n\n%s\n", mb_cstring(msg));
}
static int create_new_commit(git_repository *repo, const char *remote, const char *branch, git_oid *tree_id, bool create_empty)
@@ -1100,7 +1100,7 @@ static int create_new_commit(git_repository *repo, const char *remote, const cha
if (saved_git_id) {
if (existing_filename && verbose)
- fprintf(stderr, "existing filename %s\n", existing_filename);
+ SSRF_INFO("existing filename %s\n", existing_filename);
const git_oid *id = git_commit_id((const git_commit *) parent);
/* if we are saving to the same git tree we got this from, let's make
* sure there is no confusion */
@@ -1199,7 +1199,7 @@ static int write_git_tree(git_repository *repo, struct dir *tree, git_oid *resul
if (ret && verbose) {
const git_error *gerr = giterr_last();
if (gerr)
- fprintf(stderr, "tree_insert failed with return %d error %s\n", ret, gerr->message);
+ SSRF_INFO("tree_insert failed with return %d error %s\n", ret, gerr->message);
}
/* .. and free the now useless treebuilder */
@@ -1215,7 +1215,7 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo
bool cached_ok;
if (verbose)
- fprintf(stderr, "git storage: do git save\n");
+ SSRF_INFO("git storage: do git save\n");
if (!create_empty) // so we are actually saving the dives
git_storage_update_progress(translate("gettextFromC", "Preparing to save data"));
@@ -1238,7 +1238,7 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo
return -1;
if (verbose)
- fprintf(stderr, "git storage, write git tree\n");
+ SSRF_INFO("git storage, write git tree\n");
if (write_git_tree(repo, &tree, &id))
return report_error("git tree write failed");