logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
authorMartin Schwenke <martin@meltin.net>
Wed, 8 Oct 2014 03:22:53 +0000 (14:22 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 8 Dec 2014 11:14:13 +0000 (22:14 +1100)
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>
(Imported from commit f4fc9a153c533968905b8c7945c6615dcd9253d1)

common/ctdb_logging.c
doc/ctdb.1.xml
doc/ctdb.7.xml
server/ctdb_logging.c
tests/simple/13_ctdb_setdebug.sh

index 989e2b9db0a4c3cd3f38bb89e4da766bfa0ab4db..bb80fcd27feb81af55b8b2e6581147d048f1f95a 100644 (file)
@@ -176,8 +176,6 @@ int32_t ctdb_control_clear_log(struct ctdb_context *ctdb)
 }
 
 struct debug_levels debug_levels[] = {
-       {DEBUG_ALERT,   "ALERT"},
-       {DEBUG_CRIT,    "CRIT"},
        {DEBUG_ERR,     "ERR"},
        {DEBUG_WARNING, "WARNING"},
        {DEBUG_NOTICE,  "NOTICE"},
index eac5e119593ecb2c583d0b0bd183d6df5deeb2ed..a62d4253a7590fb0534acb2548c491f82cd7c6f9 100644 (file)
@@ -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>
 
index 61b58828deb5d0ebefba1b2732a407bec75c2a52..b54fa4267b1a1722d1a596ea6edbd48b2f03ca94 100644 (file)
@@ -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>
index f60a223647ed952745bc5a320af2a31fef5529b1..0fe376b511e44713be58b02a4c7a17138e649edb 100644 (file)
@@ -223,12 +223,6 @@ static void ctdb_syslog_log(const char *format, va_list ap)
        }
 
        switch (this_log_level) {
-       case DEBUG_ALERT: 
-               level = LOG_ALERT; 
-               break;
-       case DEBUG_CRIT: 
-               level = LOG_CRIT; 
-               break;
        case DEBUG_ERR: 
                level = LOG_ERR; 
                break;
index e4a03d5e74362e5b738844c28cbd98648033e49e..ef8b3eef41e1d86204508182a40ae83e9ad57aa3 100755 (executable)
@@ -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