1. PublishScriptOutputToNamespaceDB can fail for various reasons,
caller can't know exact reason from return values, so just printing
that the function failed in case return value is FALSE. Exact cause
must be inferred from the function's logs itself.
2. Printing log for chunkCount only if we successfully wrote it in NDB
for (i = 0; i < gFullPaths->len; i++) {
KeyNameValue tmp = g_array_index(gFullPaths, KeyNameValue, i);
if (!PublishScriptOutputToNamespaceDB(ctx, tmp.keyName, tmp.val)) {
- g_debug("%s: Failed to execute script %s or script output was empty",
+ g_debug("%s: PublishScriptOutputToNamespaceDB failed for script %s\n",
__FUNCTION__, tmp.val);
}
}
if (status) {
gchar *chunkCount = g_strdup_printf("%d", i);
status = WriteData(ctx, key, chunkCount, strlen(chunkCount));
- g_debug("%s: Written key %s chunks %s\n", __FUNCTION__, key, chunkCount);
+ if (status) {
+ g_debug("%s: Written key %s chunks %s\n", __FUNCTION__, key, chunkCount);
+ }
g_free(chunkCount);
} else if (!stdoutIsEmpty) {
g_warning("%s: Was not able to capture or store data\n", __FUNCTION__);