ctdb-daemon: Remove unused ctdb_logging.[ch]
authorAmitay Isaacs <amitay@gmail.com>
Wed, 11 Nov 2015 05:43:44 +0000 (16:43 +1100)
committerMartin Schwenke <martins@samba.org>
Sun, 15 Nov 2015 23:46:15 +0000 (00:46 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
ctdb/common/ctdb_logging.c [deleted file]
ctdb/include/ctdb_logging.h [deleted file]
ctdb/tests/src/ctdb_test.c
ctdb/tests/src/ctdbd_test.c
ctdb/wscript

diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
deleted file mode 100644 (file)
index 4f0bbed..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
-   ctdb logging code
-
-   Copyright (C) Ronnie Sahlberg 2009
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <ctype.h>
-#include "replace.h"
-#include "ctdb_logging.h"
-
-struct debug_levels {
-       int32_t level;
-       const char *description;
-};
-
-static struct debug_levels debug_levels[] = {
-       {DEBUG_ERR,     "ERR"},
-       {DEBUG_WARNING, "WARNING"},
-       {DEBUG_NOTICE,  "NOTICE"},
-       {DEBUG_INFO,    "INFO"},
-       {DEBUG_DEBUG,   "DEBUG"},
-       {0, NULL}
-};
-
-const char *get_debug_by_level(int32_t level)
-{
-       int i;
-
-       for (i=0; debug_levels[i].description != NULL; i++) {
-               if (debug_levels[i].level == level) {
-                       return debug_levels[i].description;
-               }
-       }
-       return NULL;
-}
-
-static bool get_debug_by_desc(const char *desc, int32_t *level)
-{
-       int i;
-
-       for (i=0; debug_levels[i].description != NULL; i++) {
-               if (!strcasecmp(debug_levels[i].description, desc)) {
-                       *level = debug_levels[i].level;
-                       return true;
-               }
-       }
-
-       return false;
-}
-
-bool parse_debug(const char *str, int32_t *level)
-{
-       if (isalpha(str[0])) {
-               return get_debug_by_desc(str, level);
-       } else {
-               *level = strtol(str, NULL, 0);
-               return get_debug_by_level(*level) != NULL;
-       }
-}
-
-void print_debug_levels(FILE *stream)
-{
-       int i;
-
-       for (i=0; debug_levels[i].description != NULL; i++) {
-               fprintf(stream,
-                       "%s (%d)\n",
-                       debug_levels[i].description, debug_levels[i].level);
-       }
-}
diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h
deleted file mode 100644 (file)
index da36ae0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-   ctdb logging code
-
-   Copyright (C) Andrew Tridgell  2008
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _CTDB_LOGGING_H_
-#define _CTDB_LOGGING_H_
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <talloc.h>
-
-#include "common/logging.h"
-
-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_ */
index 83cf7c8626bd24215510e07b00f6b60875b49aff..864ae8774f2fc8c9d7f62dc9077d2b707ae092d4 100644 (file)
@@ -175,7 +175,6 @@ ctdb_get_capabilities(struct ctdb_context *ctdb,
 #include "common/db_hash.c"
 #include "common/srvid.c"
 #include "common/rb_tree.c"
-#include "common/ctdb_logging.c"
 #include "common/system_util.c"
 #include "common/reqid.c"
 #include "common/logging.c"
index 721a5f13db1af8dad965cb3dc85a39a6ce9b0501..92404157a84c6f733837bd761a5ffdee988b10af 100644 (file)
@@ -45,7 +45,6 @@ bool fast_start;
 #include "common/srvid.c"
 #include "common/cmdline.c"
 #include "common/rb_tree.c"
-#include "common/ctdb_logging.c"
 #include "common/system_util.c"
 #include "common/reqid.c"
 #include "common/logging.c"
index 71973476e0fa7059d54b444dafe428a651abb095..506c8ab4fb83e98ad3e244f775bab742ef577fc9 100755 (executable)
@@ -338,7 +338,7 @@ def build(bld):
 
     bld.SAMBA_SUBSYSTEM('ctdb-common-util',
                         source=bld.SUBDIR('common',
-                                          'system_util.c ctdb_logging.c'),
+                                          'system_util.c'),
                         includes='include',
                         deps='replace tevent tdb')