X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fstore.c;h=ae6bdb67ea99eaa561e679e29725d44fca9217dc;hb=ebccbd4672947c51d87fc939b2da223df4b05448;hp=48a69b478097d2937e199a9d863e45243d81869b;hpb=cf3d405919942d3adf810bba0ed5df28a91b6d2d;p=bluesky.git diff --git a/bluesky/store.c b/bluesky/store.c index 48a69b4..ae6bdb6 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -219,9 +219,11 @@ void bluesky_store_async_mark_complete(BlueSkyStoreAsync *async) g_thread_pool_push(notifier_thread_pool, nl, NULL); } - g_log("bluesky/store", G_LOG_LEVEL_DEBUG, - "[%p] complete: elapsed = %"PRIi64" ns, latency = %"PRIi64" ns", - async, elapsed, latency); + if (bluesky_verbose) { + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, + "[%p] complete: elapsed = %"PRIi64" ns, latency = %"PRIi64" ns", + async, elapsed, latency); + } } void bluesky_store_async_submit(BlueSkyStoreAsync *async) @@ -234,13 +236,15 @@ void bluesky_store_async_submit(BlueSkyStoreAsync *async) // processing was started, if there could be a delay from submission time. async->exec_time = bluesky_now_hires(); - g_log("bluesky/store", G_LOG_LEVEL_DEBUG, "[%p] submit: %s %s", - async, - async->op == STORE_OP_GET ? "GET" - : async->op == STORE_OP_PUT ? "PUT" - : async->op == STORE_OP_DELETE ? "DELETE" - : async->op == STORE_OP_BARRIER ? "BARRIER" : "???", - async->key); + if (bluesky_verbose) { + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, "[%p] submit: %s %s", + async, + async->op == STORE_OP_GET ? "GET" + : async->op == STORE_OP_PUT ? "PUT" + : async->op == STORE_OP_DELETE ? "DELETE" + : async->op == STORE_OP_BARRIER ? "BARRIER" : "???", + async->key); + } /* Barriers are handled specially, and not handed down the storage * implementation layer. */ @@ -302,12 +306,17 @@ static void notifier_task(gpointer n, gpointer s) void bluesky_store_sync(BlueSkyStore *store) { g_mutex_lock(store->lock); - g_print("Waiting for pending store operations to complete...\n"); + if (bluesky_verbose) { + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, + "Waiting for pending store operations to complete..."); + } while (store->pending > 0) { g_cond_wait(store->cond_idle, store->lock); } g_mutex_unlock(store->lock); - g_print("Operations are complete.\n"); + if (bluesky_verbose) { + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, "Operations are complete."); + } } /* Convenience wrappers that perform a single operation synchronously. */