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)
}
struct debug_levels debug_levels[] = {
- {DEBUG_ALERT, "ALERT"},
- {DEBUG_CRIT, "CRIT"},
{DEBUG_ERR, "ERR"},
{DEBUG_WARNING, "WARNING"},
{DEBUG_NOTICE, "NOTICE"},
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>
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>
</para>
<simplelist>
- <member>ALERT (-2)</member>
- <member>CRIT (-1)</member>
<member>ERR (0)</member>
<member>WARNING (1)</member>
<member>NOTICE (2)</member>
}
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;
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