SQ snapper: clean up DEBUG statements
authorDavid Disseldorp <ddiss@samba.org>
Wed, 17 Oct 2012 12:08:14 +0000 (14:08 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Mon, 15 Apr 2013 16:15:22 +0000 (18:15 +0200)
source3/modules/vfs_snapper.c

index adbed1058242ca542ba8fc274d3fb15c89863060..d45121b2de6f799af322071e931a2f6affc72bf0 100644 (file)
@@ -182,11 +182,8 @@ static void snapper_dict_array_print(uint32_t num_dicts,
        int i;
 
        for (i = 0; i < num_dicts; i++) {
-               DEBUG(0, ("dict (\n"
-                         "\tkey: %s\n"
-                         "\tval: %s\n"
-                         ")\n",
-                         dicts[i].key, dicts[i].val));
+               DEBUG(10, ("dict (key: %s, val: %s)\n",
+                          dicts[i].key, dicts[i].val));
        }
 }
 
@@ -318,9 +315,8 @@ static void snapper_conf_array_print(int32_t num_confs,
        int i;
 
        for (i = 0; i < num_confs; i++) {
-               DEBUG(0, ("name: %s\n"
-                         "mnt: %s\n",
-                         confs[i].name, confs[i].mnt));
+               DEBUG(10, ("name: %s, mnt: %s\n",
+                          confs[i].name, confs[i].mnt));
                snapper_dict_array_print(confs[i].num_attrs, confs[i].attrs);
        }
 }
@@ -412,6 +408,8 @@ static NTSTATUS snapper_list_confs_unpack(TALLOC_CTX *mem_ctx,
                return status;
        }
 
+       snapper_conf_array_print(num_confs, confs);
+
        *num_confs_out = num_confs;
        *confs_out = confs;
 
@@ -531,20 +529,20 @@ static void snapper_snap_array_print(int32_t num_snaps,
        int i;
 
        for (i = 0; i < num_snaps; i++) {
-               DEBUG(0, ("id: %u\n"
-                         "type: %u\n"
-                         "pre_id: %u\n"
-                         "time: %lu\n"
-                         "creator_uid: %u\n"
-                         "desc: %s\n"
-                         "cleanup: %s\n",
-                         snaps[i].id,
-                         snaps[i].type,
-                         snaps[i].pre_id,
-                         snaps[i].time,
-                         snaps[i].creator_uid,
-                         snaps[i].desc,
-                         snaps[i].cleanup));
+               DEBUG(10, ("id: %u, "
+                          "type: %u, "
+                          "pre_id: %u, "
+                          "time: %lu, "
+                          "creator_uid: %u, "
+                          "desc: %s, "
+                          "cleanup: %s\n",
+                          snaps[i].id,
+                          snaps[i].type,
+                          snaps[i].pre_id,
+                          snaps[i].time,
+                          snaps[i].creator_uid,
+                          snaps[i].desc,
+                          snaps[i].cleanup));
                snapper_dict_array_print(snaps[i].num_user_data,
                                         snaps[i].user_data);
        }
@@ -638,6 +636,8 @@ static NTSTATUS snapper_list_snaps_unpack(TALLOC_CTX *mem_ctx,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
+       snapper_snap_array_print(num_snaps, snaps);
+
        *num_snaps_out = num_snaps;
        *snaps_out = snaps;
 
@@ -658,7 +658,7 @@ static NTSTATUS snapper_create_snap_pack(const char *snapper_conf,
        uint32_t i;
        bool ok;
 
-       DEBUG(0, ("CreateSingleSnapshot: %s, %s, %s, num user %u\n",
+       DEBUG(10, ("CreateSingleSnapshot: %s, %s, %s, num user %u\n",
                  snapper_conf, desc, empty, num_user_data));
 
        msg = dbus_message_new_method_call("org.opensuse.Snapper",
@@ -1397,12 +1397,10 @@ static int snapper_get_shadow_copy_data(struct vfs_handle_struct *handle,
        }
        /* we should always get at least one snapshot (current) */
        if (num_snaps == 0) {
-               DEBUG(0, ("zero snapshots in snap list response\n"));
+               DEBUG(6, ("zero snapshots in snap list response\n"));
                goto err_rsp_free;
        }
 
-       snapper_snap_array_print(num_snaps, snaps);
-
        /* subtract 1, (current) snapshot is not returned */
        sc_data->num_volumes = num_snaps - 1;
        sc_data->labels = NULL;
@@ -1412,7 +1410,8 @@ static int snapper_get_shadow_copy_data(struct vfs_handle_struct *handle,
                goto done;
        }
 
-       sc_data->labels = talloc_array(sc_data, SHADOW_COPY_LABEL, sc_data->num_volumes);
+       sc_data->labels = talloc_array(sc_data, SHADOW_COPY_LABEL,
+                                      sc_data->num_volumes);
        if (sc_data->labels == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto err_rsp_free;
@@ -1496,11 +1495,11 @@ static NTSTATUS snapper_get_snap_at_time_call(TALLOC_CTX *mem_ctx,
        }
 
        if (num_snaps == 0) {
-               DEBUG(2, ("no snapshots found with time: %lu\n", snaptime));
+               DEBUG(4, ("no snapshots found with time: %lu\n", snaptime));
                status = NT_STATUS_INVALID_PARAMETER;
                goto err_snap_array_free;
        } else if (num_snaps > 0) {
-               DEBUG(2, ("got %u snapshots for single time %lu, using top\n",
+               DEBUG(4, ("got %u snapshots for single time %lu, using top\n",
                          num_snaps, snaptime));
        }