diff options
| author | Martin Schwenke <martin@meltin.net> | 2014-08-08 13:36:00 +1000 |
|---|---|---|
| committer | Amitay Isaacs <amitay@samba.org> | 2014-10-28 05:42:04 +0100 |
| commit | a22c8ca05618a63d6923fcf7dc567d1cd6119009 (patch) | |
| tree | 9b9ec1166c1eb34170e67eba218b316e5a94c57c /ctdb/include | |
| parent | d9d572a23cf527780caae9d7ff143376e9057f6a (diff) | |
ctdb-logging: Rework debug level parsing
Put declarations into ctdb_logging.h, factor out some common code,
clean up #includes.
Remove the check so see if the 1st character of the debug level is
'-'. This is wrong, since it is trying to check for a negative
numeric debug level (which is no longer supported) and would need to
be handled in the else anyway.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/include')
| -rw-r--r-- | ctdb/include/ctdb_client.h | 9 | ||||
| -rw-r--r-- | ctdb/include/ctdb_logging.h | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h index aa1145bcfa..ac235139e3 100644 --- a/ctdb/include/ctdb_client.h +++ b/ctdb/include/ctdb_client.h @@ -564,15 +564,6 @@ int ctdb_ctrl_getscriptstatus(struct ctdb_context *ctdb, struct ctdb_scripts_wire **script_status); -struct debug_levels { - int32_t level; - const char *description; -}; -extern struct debug_levels debug_levels[]; - -const char *get_debug_by_level(int32_t level); -int32_t get_debug_by_desc(const char *desc); - int ctdb_ctrl_stop_node(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode); int ctdb_ctrl_continue_node(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode); diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h index 6faf3d947b..615e41afc2 100644 --- a/ctdb/include/ctdb_logging.h +++ b/ctdb/include/ctdb_logging.h @@ -20,6 +20,10 @@ #ifndef _CTDB_LOGGING_H_ #define _CTDB_LOGGING_H_ +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> + extern const char *debug_extra; enum debug_level { @@ -34,4 +38,8 @@ enum debug_level { #define DEBUG_ALERT DEBUG_ERR #define DEBUG_CRIT DEBUG_ERR +const char *get_debug_by_level(int32_t level); +bool parse_debug(const char *str, int32_t *level); +void print_debug_levels(FILE *stream); + #endif /* _CTDB_LOGGING_H_ */ |
