X-Git-Url: http://git.vrable.net/?p=bluesky.git;a=blobdiff_plain;f=bluesky%2Flog.c;h=ccc9a7a712bafc698ae17dfcc87cff6b50f2e2e9;hp=6ac750876121144a46bee0054b1d60e81964ccad;hb=b52abd849493636b81dda8c752a60834f1a6b91f;hpb=f782ebd939e2d81808ad63da0a6ff36e88938da2 diff --git a/bluesky/log.c b/bluesky/log.c index 6ac7508..ccc9a7a 100644 --- a/bluesky/log.c +++ b/bluesky/log.c @@ -34,10 +34,6 @@ * only incompletely written out before a crash, which should only happen for * log records that were not considered committed). */ -// Rough size limit for a log segment. This is not a firm limit and there are -// no absolute guarantees on the size of a log segment. -#define LOG_SEGMENT_SIZE (1 << 22) - #define HEADER_MAGIC 0x676f4c0a #define FOOTER_MAGIC 0x2e435243 @@ -482,8 +478,9 @@ static void cloudlog_partial_fetch_start(BlueSkyCacheFile *cachefile, size_t offset, size_t length) { g_atomic_int_inc(&cachefile->refcount); - g_print("Starting partial fetch of %s from cloud (%zd + %zd)\n", - cachefile->filename, offset, length); + if (bluesky_verbose) + g_print("Starting partial fetch of %s from cloud (%zd + %zd)\n", + cachefile->filename, offset, length); BlueSkyStoreAsync *async = bluesky_store_async_new(cachefile->fs->store); async->op = STORE_OP_GET; async->key = g_strdup(cachefile->filename); @@ -500,13 +497,15 @@ static void cloudlog_partial_fetch_start(BlueSkyCacheFile *cachefile, static void cloudlog_partial_fetch_complete(BlueSkyStoreAsync *async, BlueSkyCacheFile *cachefile) { - g_print("Fetch of %s from cloud complete, status = %d\n", - async->key, async->result); + if (bluesky_verbose || async->result != 0) + g_print("Fetch of %s from cloud complete, status = %d\n", + async->key, async->result); g_mutex_lock(cachefile->lock); if (async->result >= 0) { if (async->len == 0) { - g_print("Complete object was fetched.\n"); + if (bluesky_verbose) + g_print("Complete object was fetched.\n"); cachefile->complete = TRUE; } @@ -553,7 +552,7 @@ static void cloudlog_partial_fetch_complete(BlueSkyStoreAsync *async, bluesky_rangeset_free(items); } else { - g_print("Error fetching from cloud, retrying...\n"); + g_print("Error fetching %s from cloud, retrying...\n", async->key); cloudlog_partial_fetch_start(cachefile, async->start, async->len); } @@ -576,7 +575,8 @@ static void cloudlog_fetch_start(BlueSkyCacheFile *cachefile) { g_atomic_int_inc(&cachefile->refcount); cachefile->fetching = TRUE; - g_print("Starting fetch of %s from cloud\n", cachefile->filename); + if (bluesky_verbose) + g_print("Starting fetch of %s from cloud\n", cachefile->filename); BlueSkyStoreAsync *async = bluesky_store_async_new(cachefile->fs->store); async->op = STORE_OP_GET; async->key = g_strdup(cachefile->filename);