1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

ctdb-daemon: Remove unused ctdb_logging.[ch]

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Amitay Isaacs 2015-11-11 16:43:44 +11:00 committed by Martin Schwenke
parent 27bc80cf6a
commit 0fffdc1901
5 changed files with 1 additions and 120 deletions

View File

@ -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);
}
}

View File

@ -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_ */

View 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"

View 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"

View File

@ -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')