Skip to content

Commit

Permalink
Merge pull request #15 from jean-edouard/noverbose
Browse files Browse the repository at this point in the history
Disable verbose log
  • Loading branch information
rossphilipson authored Apr 4, 2017
2 parents ea0419a + a69ec70 commit d6bd987
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void fill_vms()
which is fine since we'll get new VM notifications once xenmgr is up and runnning */
com_citrix_xenclient_xenmgr_list_vms_(g_xcbus, XENMGR, XENMGR_OBJ, &paths);
if (!com_citrix_xenclient_xenmgr_list_vms_(g_xcbus, XENMGR, XENMGR_OBJ, &paths)) {
xd_log(LOG_WARN, "Unable to get the list of VMs");
xd_log(LOG_WARNING, "Unable to get the list of VMs");
return;
}

Expand Down
7 changes: 6 additions & 1 deletion src/project.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@
/**
* The (stupid) logging macro
*/
#define xd_log(I, ...) do { fprintf(stderr, ##__VA_ARGS__); fprintf(stderr, "\n"); } while (0)
#define xd_log(I, ...) do { \
if (I == LOG_DEBUG) \
break; \
fprintf(stderr, ##__VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (0)

/**
* @brief VM structure
Expand Down
2 changes: 1 addition & 1 deletion src/udev.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ udev_settle(void)

queue = udev_queue_new(udev_handle);
if (!queue) {
xd_log(LOG_WARN, "udev_queue_new failed");
xd_log(LOG_WARNING, "udev_queue_new failed");
/* We failed to get a queue, let's just sleep 0.1 seconds,
it's usually enough the get udev settled... */
usleep(100000);
Expand Down
2 changes: 1 addition & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ vm_add(const int domid, const char *uuid)
return NULL;
}
if (!strcmp(vm->uuid, new_uuid)) {
xd_log(LOG_WARN, "VM already registered: %s. Changing domid", new_uuid);
xd_log(LOG_WARNING, "VM already registered: %s. Changing domid", new_uuid);
vm->domid = domid;
return vm;
}
Expand Down
4 changes: 2 additions & 2 deletions src/xenstore.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ xenstore_add_dir(xs_transaction_t xt, char *path, int d0, int p0, int d1, int p1
{
struct xs_permissions perms[2];

xd_log(LOG_VERBOSE_DEBUG, "Making %s in XenStore", path);
xd_log(LOG_DEBUG, "Making %s in XenStore", path);
if (xs_mkdir(xs_handle, xt, path) == false) {
xd_log(LOG_ERR, "XenStore error mkdir()ing %s", path);
return -1;
Expand Down Expand Up @@ -175,7 +175,7 @@ xenstore_set_keyval(xs_transaction_t xt, char *path, char *key, char *val)
snprintf(tmppath, sizeof (tmppath), "%s/%s", path, key);
path = tmppath;
}
xd_log(LOG_VERBOSE_DEBUG, "Writing to XenStore: %s = %s", path, val);
xd_log(LOG_DEBUG, "Writing to XenStore: %s = %s", path, val);

if (xs_write(xs_handle, xt, path, val, strlen(val)) == false) {
xd_log(LOG_ERR, "XenStore error writing %s", path);
Expand Down

0 comments on commit d6bd987

Please sign in to comment.