summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-10-08 14:22:53 +1100
committerAmitay Isaacs <amitay@samba.org>2014-10-28 05:42:04 +0100
commitf4fc9a153c533968905b8c7945c6615dcd9253d1 (patch)
tree50cd15eb323422ad4966ce96c5f56f658be78597 /ctdb
parent0eabbb8c2b91b61a23f20e04605fdbd653c5cbcb (diff)
downloadsamba-f4fc9a153c533968905b8c7945c6615dcd9253d1.tar.gz
ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
Internally map them to DEBUG_ERR to limit code churn. This reduces the unwieldy number of debug levels used by CTDB. ALERT and CRIT aren't of much use as separate errors, since everything from ERR up should always be logged. In future just ERR can be used. This also improves compatibility with Samba's debug.c system priority mapping. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/ctdb_logging.c2
-rw-r--r--ctdb/doc/ctdb.1.xml4
-rw-r--r--ctdb/doc/ctdb.7.xml2
-rw-r--r--ctdb/include/ctdb_logging.h6
-rw-r--r--ctdb/server/ctdb_logging.c6
-rwxr-xr-xctdb/tests/simple/13_ctdb_setdebug.sh2
6 files changed, 7 insertions, 15 deletions
diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
index f6d8df757a9..c79397d03f0 100644
--- a/ctdb/common/ctdb_logging.c
+++ b/ctdb/common/ctdb_logging.c
@@ -26,8 +26,6 @@
const char *debug_extra = "";
struct debug_levels debug_levels[] = {
- {DEBUG_ALERT, "ALERT"},
- {DEBUG_CRIT, "CRIT"},
{DEBUG_ERR, "ERR"},
{DEBUG_WARNING, "WARNING"},
{DEBUG_NOTICE, "NOTICE"},
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 7e12c7a06e2..170d05a9fa1 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -902,7 +902,7 @@ DB Statistics: locking.tdb
The list of debug levels from highest to lowest are :
</para>
<para>
- ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
@@ -912,7 +912,7 @@ DB Statistics: locking.tdb
Set the debug level of a node. This controls what information will be logged.
</para>
<para>
- The debuglevel is one of ALERT CRIT ERR WARNING NOTICE INFO DEBUG
+ The debuglevel is one of ERR WARNING NOTICE INFO DEBUG
</para>
</refsect2>
diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml
index 61b58828deb..b54fa4267b1 100644
--- a/ctdb/doc/ctdb.7.xml
+++ b/ctdb/doc/ctdb.7.xml
@@ -883,8 +883,6 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
</para>
<simplelist>
- <member>ALERT (-2)</member>
- <member>CRIT (-1)</member>
<member>ERR (0)</member>
<member>WARNING (1)</member>
<member>NOTICE (2)</member>
diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h
index 1fd61239913..6faf3d947bb 100644
--- a/ctdb/include/ctdb_logging.h
+++ b/ctdb/include/ctdb_logging.h
@@ -23,8 +23,6 @@
extern const char *debug_extra;
enum debug_level {
- DEBUG_ALERT = -2,
- DEBUG_CRIT = -1,
DEBUG_ERR = 0,
DEBUG_WARNING = 1,
DEBUG_NOTICE = 2,
@@ -32,4 +30,8 @@ enum debug_level {
DEBUG_DEBUG = 4,
};
+/* These are used in many places, so define them here to avoid churn */
+#define DEBUG_ALERT DEBUG_ERR
+#define DEBUG_CRIT DEBUG_ERR
+
#endif /* _CTDB_LOGGING_H_ */
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index b1e53cf6280..25d27225880 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -218,12 +218,6 @@ static void ctdb_syslog_log(void *private_ptr, int dbglevel, const char *s)
struct sockaddr_in syslog_sin;
switch (dbglevel) {
- case DEBUG_ALERT:
- level = LOG_ALERT;
- break;
- case DEBUG_CRIT:
- level = LOG_CRIT;
- break;
case DEBUG_ERR:
level = LOG_ERR;
break;
diff --git a/ctdb/tests/simple/13_ctdb_setdebug.sh b/ctdb/tests/simple/13_ctdb_setdebug.sh
index e4a03d5e743..ef8b3eef41e 100755
--- a/ctdb/tests/simple/13_ctdb_setdebug.sh
+++ b/ctdb/tests/simple/13_ctdb_setdebug.sh
@@ -53,7 +53,7 @@ set_and_check_debug ()
get_debug $test_node
initial_debug="$check_debug"
-levels="ALERT CRIT ERR WARNING NOTICE INFO DEBUG"
+levels="ERR WARNING NOTICE INFO DEBUG"
for new_debug in $levels ; do
[ "$initial_debug" != "$new_debug" ] || continue