This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - groupd/fenced/dlm_controld/gfs_controld: log macros
- From: David Teigland <teigland at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Thu, 20 Nov 2008 18:30:58 +0000 (UTC)
- Subject: cluster: master - groupd/fenced/dlm_controld/gfs_controld: log macros
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=140001e065c51283a02d924b75c770ba24118a1b
Commit: 140001e065c51283a02d924b75c770ba24118a1b
Parent: 1c55635bb000a99958bb40fe972824dd92f1d7ff
Author: David Teigland <teigland@redhat.com>
AuthorDate: Thu Nov 20 12:25:48 2008 -0600
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Thu Nov 20 12:29:40 2008 -0600
groupd/fenced/dlm_controld/gfs_controld: log macros
Restore the original method of creating the debug string with a
time stamp that's used for the memory debug buffer and stderr.
The call to logt_print can just use the fmt/args directly; using
the temp debug string is pointless.
Signed-off-by: David Teigland <teigland@redhat.com>
---
fence/fenced/fd.h | 4 ++--
group/daemon/gd_internal.h | 16 ++++++++--------
group/dlm_controld/dlm_daemon.h | 14 ++++++++------
group/gfs_controld/gfs_daemon.h | 12 +++++++-----
4 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/fence/fenced/fd.h b/fence/fenced/fd.h
index f8fb0eb..329832d 100644
--- a/fence/fenced/fd.h
+++ b/fence/fenced/fd.h
@@ -76,9 +76,9 @@ extern void daemon_dump_save(void);
#define log_level(lvl, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, fmt "\n", ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
daemon_dump_save(); \
- logt_print(lvl, "%s", daemon_debug_buf); \
+ logt_print(lvl, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
diff --git a/group/daemon/gd_internal.h b/group/daemon/gd_internal.h
index cda11cc..4e803bb 100644
--- a/group/daemon/gd_internal.h
+++ b/group/daemon/gd_internal.h
@@ -72,38 +72,38 @@ void daemon_dump_save(void);
#define log_debug(fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, fmt "\n", ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
daemon_dump_save(); \
- logt_print(LOG_DEBUG, "%s", daemon_debug_buf); \
+ logt_print(LOG_DEBUG, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
#define log_group(g, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%d:%s " fmt "\n", \
+ snprintf(daemon_debug_buf, 255, "%ld %d:%s " fmt "\n", time(NULL), \
(g)->level, (g)->name, ##args); \
daemon_dump_save(); \
- logt_print(LOG_DEBUG, "%s", daemon_debug_buf); \
+ logt_print(LOG_DEBUG, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
#define log_print(fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, fmt "\n", ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
daemon_dump_save(); \
- logt_print(LOG_ERR, "%s", daemon_debug_buf); \
+ logt_print(LOG_ERR, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
#define log_error(g, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%d:%s " fmt "\n", \
+ snprintf(daemon_debug_buf, 255, "%ld %d:%s " fmt "\n", time(NULL), \
(g)->level, (g)->name, ##args); \
daemon_dump_save(); \
- logt_print(LOG_ERR, "%s", daemon_debug_buf); \
+ logt_print(LOG_ERR, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index 774f4f4..412149b 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -46,7 +46,7 @@
The libcpg limit is larger at CPG_MAX_NAME_LENGTH 128. Our cpg name includes
a "dlm:" prefix before the lockspace name. */
-/* Maximum members of a lockspace, should match CPG_MEMBERS_MAX in corosync/cpg.h.
+/* Maximum members of a ls, should match CPG_MEMBERS_MAX in corosync/cpg.h.
There are no max defines in dlm-kernel for lockspace members. */
#define MAX_NODES 128
@@ -93,9 +93,9 @@ void daemon_dump_save(void);
#define log_level(lvl, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, fmt "\n", ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
daemon_dump_save(); \
- logt_print(lvl, "%s", daemon_debug_buf); \
+ logt_print(lvl, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
@@ -105,16 +105,18 @@ do { \
#define log_group(ls, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%s " fmt "\n", (ls)->name, ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
+ (ls)->name, ##args); \
daemon_dump_save(); \
- logt_print(LOG_DEBUG, "%s", daemon_debug_buf); \
+ logt_print(LOG_DEBUG, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
#define log_plock(ls, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%s " fmt "\n", (ls)->name, ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
+ (ls)->name, ##args); \
if (daemon_debug_opt && cfgd_plock_debug) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index 1887365..ce386d1 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -91,9 +91,9 @@ void daemon_dump_save(void);
#define log_level(lvl, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, fmt "\n", ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld " fmt "\n", time(NULL), ##args); \
daemon_dump_save(); \
- logt_print(lvl, "%s", daemon_debug_buf); \
+ logt_print(lvl, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
@@ -103,16 +103,18 @@ do { \
#define log_group(g, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%s " fmt "\n", (g)->name, ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
+ (g)->name, ##args); \
daemon_dump_save(); \
- logt_print(LOG_DEBUG, "%s", daemon_debug_buf); \
+ logt_print(LOG_DEBUG, fmt "\n", ##args); \
if (daemon_debug_opt) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)
#define log_plock(g, fmt, args...) \
do { \
- snprintf(daemon_debug_buf, 255, "%s " fmt "\n", (g)->name, ##args); \
+ snprintf(daemon_debug_buf, 255, "%ld %s " fmt "\n", time(NULL), \
+ (g)->name, ##args); \
if (daemon_debug_opt && cfgd_plock_debug) \
fprintf(stderr, "%s", daemon_debug_buf); \
} while (0)