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>
const char *debug_extra = "";
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>
extern const char *debug_extra;
enum debug_level {
- DEBUG_ALERT = -2,
- DEBUG_CRIT = -1,
DEBUG_ERR = 0,
DEBUG_WARNING = 1,
DEBUG_NOTICE = 2,
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_ */
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;
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