From 151c0ccf481d8e58581d7848f9aeb0e7704f0208 Mon Sep 17 00:00:00 2001 From: Mohamed Ashiq Date: Tue, 19 May 2015 15:11:45 +0530 Subject: graph/libglusterfs : porting to a new logging framework Change-Id: I57ed5c979c15559443712a61f0b1a61c7f5557d8 BUG: 1194640 Signed-off-by: Mohamed Ashiq Reviewed-on: http://review.gluster.org/10822 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- libglusterfs/src/graph-print.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libglusterfs/src/graph-print.c') 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; } -- cgit