summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/graph-print.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:11:45 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-25 19:58:08 -0700
commit151c0ccf481d8e58581d7848f9aeb0e7704f0208 (patch)
tree742e9be4fb255597d1af1ce6f95c05db0334e161 /libglusterfs/src/graph-print.c
parentd3714f252d91f4d1d5df05c4dcc8bc7c2ee75326 (diff)
graph/libglusterfs : porting to a new logging framework
Change-Id: I57ed5c979c15559443712a61f0b1a61c7f5557d8 BUG: 1194640 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/10822 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/graph-print.c')
-rw-r--r--libglusterfs/src/graph-print.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libglusterfs/src/graph-print.c b/libglusterfs/src/graph-print.c
index d352cc798b8..676167b17d2 100644
--- a/libglusterfs/src/graph-print.c
+++ b/libglusterfs/src/graph-print.c
@@ -13,7 +13,7 @@
#include "common-utils.h"
#include "xlator.h"
#include "graph-utils.h"
-
+#include "libglusterfs-messages.h"
struct gf_printer {
@@ -28,8 +28,8 @@ gp_write_file (struct gf_printer *gp, char *buf, size_t len)
FILE *f = gp->priv;
if (fwrite (buf, len, 1, f) != 1) {
- gf_log ("graph-print", GF_LOG_ERROR, "fwrite failed (%s)",
- strerror (errno));
+ gf_msg ("graph-print", GF_LOG_ERROR, errno,
+ LG_MSG_FWRITE_FAILED, "fwrite failed");
return -1;
}
@@ -43,7 +43,8 @@ gp_write_buf (struct gf_printer *gp, char *buf, size_t len)
struct iovec *iov = gp->priv;
if (iov->iov_len < len) {
- gf_log ("graph-print", GF_LOG_ERROR, "buffer full");
+ gf_msg ("graph-print", GF_LOG_ERROR, 0, LG_MSG_BUFFER_FULL,
+ "buffer full");
return -1;
}
@@ -134,7 +135,8 @@ glusterfs_graph_print (struct gf_printer *gp, glusterfs_graph_t *graph)
out:
len = gp->len;
if (ret == -1) {
- gf_log ("graph-print", GF_LOG_ERROR, "printing failed");
+ gf_msg ("graph-print", GF_LOG_ERROR, 0, LG_MSG_PRINT_FAILED,
+ "printing failed");
return -1;
}
@@ -167,8 +169,8 @@ glusterfs_graph_print_buf (glusterfs_graph_t *graph)
f = fopen ("/dev/null", "a");
if (!f) {
- gf_log ("graph-print", GF_LOG_ERROR,
- "cannot open /dev/null (%s)", strerror (errno));
+ gf_msg ("graph-print", GF_LOG_ERROR, errno,
+ LG_MSG_DIR_OP_FAILED, "cannot open /dev/null");
return NULL;
}