summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohamed Ashiq <mliyazud@redhat.com>2015-08-12 15:21:17 +0530
committerNiels de Vos <ndevos@redhat.com>2015-09-08 00:56:55 -0700
commit5046fc8f267851b4ce530f8a3ba41d5ac5c9ea87 (patch)
tree6d5514a750f950e41e60deb35d3e0ab68f8422ef /libglusterfs
parentc87cef1763aac974bcd335965ba44fab46e4326d (diff)
libglusterfs:Porting log messages to new framework
Backport of http://review.gluster.org/11896 Cherry picked from 038dfe57cf0c5944b0392332dbf5a00bb1208150 >Change-Id: I8625b7dc8941720cc7a864b8fddbcc7b4c485fcd >BUG: 1252836 >Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> >Reviewed-on: http://review.gluster.org/11896 >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Tested-by: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> >Reviewed-by: Niels de Vos <ndevos@redhat.com> Change-Id: I8625b7dc8941720cc7a864b8fddbcc7b4c485fcd BUG: 1258769 Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> Reviewed-on: http://review.gluster.org/12076 Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/libglusterfs-messages.h26
-rw-r--r--libglusterfs/src/run.c4
-rw-r--r--libglusterfs/src/timespec.c5
-rw-r--r--libglusterfs/src/xlator.c10
4 files changed, 34 insertions, 11 deletions
diff --git a/libglusterfs/src/libglusterfs-messages.h b/libglusterfs/src/libglusterfs-messages.h
index 25cca8bac3e..68754e6b869 100644
--- a/libglusterfs/src/libglusterfs-messages.h
+++ b/libglusterfs/src/libglusterfs-messages.h
@@ -36,7 +36,7 @@
*/
#define GLFS_LG_BASE GLFS_MSGID_COMP_LIBGLUSTERFS
-#define GLFS_LG_NUM_MESSAGES 201
+#define GLFS_LG_NUM_MESSAGES 204
#define GLFS_LG_MSGID_END (GLFS_LG_BASE + GLFS_LG_NUM_MESSAGES + 1)
/* Messaged with message IDs */
#define glfs_msg_start_lg GLFS_LG_BASE, "Invalid: Start of messages"
@@ -1722,6 +1722,30 @@
* @recommendedaction
*
*/
+#define LG_MSG_SET_LOG_LEVEL (GLFS_LG_BASE + 202)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+#define LG_MSG_VERIFY_PLATFORM (GLFS_LG_BASE + 203)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+#define LG_MSG_RUNNER_LOG (GLFS_LG_BASE + 204)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
/*------------*/
#define glfs_msg_end_lg GLFS_LG_MSGID_END, "Invalid: End of messages"
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 5d7f1d207b1..6018a58ad5f 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -43,8 +43,8 @@
#include "common-utils.h"
#endif
+#include "libglusterfs-messages.h"
#include "run.h"
-
void
runinit (runner_t *runner)
{
@@ -187,7 +187,7 @@ runner_log (runner_t *runner, const char *dom, gf_loglevel_t lvl,
if (len > 0)
buf[len - 1] = '\0';
- gf_log_callingfn (dom, lvl, "%s: %s", msg, buf);
+ gf_msg_callingfn (dom, lvl, 0, LG_MSG_RUNNER_LOG, "%s: %s", msg, buf);
GF_FREE (buf);
}
diff --git a/libglusterfs/src/timespec.c b/libglusterfs/src/timespec.c
index 5242ecc8cd0..f7b2bea2f30 100644
--- a/libglusterfs/src/timespec.c
+++ b/libglusterfs/src/timespec.c
@@ -20,6 +20,7 @@ static mach_timebase_info_data_t gf_timebase;
#include "logging.h"
#include "timespec.h"
+#include "libglusterfs-messages.h"
void timespec_now (struct timespec *ts)
{
@@ -51,10 +52,6 @@ void timespec_now (struct timespec *ts)
ts->tv_nsec = (time - (ts->tv_sec * GIGA));
#endif /* Platform verification */
- /*
- gf_log_callingfn ("timer", GF_LOG_TRACE, "%"GF_PRI_TIME".%09"GF_PRI_TIME,
- ts->tv_sec, ts->tv_nsec);
- */
}
void timespec_adjust_delta (struct timespec *ts, struct timespec delta)
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 52f96c94a50..0de13900914 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -981,8 +981,8 @@ is_gf_log_command (xlator_t *this, const char *name, char *value)
/* Some crude way to change the log-level of process */
if (!strcmp (name, "trusted.glusterfs.set-log-level")) {
- /* */
- gf_log ("glusterfs", gf_log_get_loglevel(),
+ gf_msg ("glusterfs", gf_log_get_loglevel(), 0,
+ LG_MSG_SET_LOG_LEVEL,
"setting log level to %d (old-value=%d)",
log_level, gf_log_get_loglevel());
gf_log_set_loglevel (log_level);
@@ -992,7 +992,8 @@ is_gf_log_command (xlator_t *this, const char *name, char *value)
if (!strcmp (name, "trusted.glusterfs.fuse.set-log-level")) {
/* */
- gf_log (this->name, gf_log_get_xl_loglevel (this),
+ gf_msg (this->name, gf_log_get_xl_loglevel (this), 0,
+ LG_MSG_SET_LOG_LEVEL,
"setting log level to %d (old-value=%d)",
log_level, gf_log_get_xl_loglevel (this));
gf_log_set_xl_loglevel (this, log_level);
@@ -1011,7 +1012,8 @@ is_gf_log_command (xlator_t *this, const char *name, char *value)
snprintf (key, 1024, "trusted.glusterfs.%s.set-log-level",
trav->name);
if (fnmatch (name, key, FNM_NOESCAPE) == 0) {
- gf_log (trav->name, gf_log_get_xl_loglevel (trav),
+ gf_msg (trav->name, gf_log_get_xl_loglevel (trav), 0,
+ LG_MSG_SET_LOG_LEVEL,
"setting log level to %d (old-value=%d)",
log_level, gf_log_get_xl_loglevel (trav));
gf_log_set_xl_loglevel (trav, log_level);