4 Copyright (C) Ronnie Sahlberg 2009
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #include "system/time.h"
23 #include "../include/ctdb_private.h"
24 #include "../include/ctdb_client.h"
26 const char *debug_extra
= "";
28 struct debug_levels debug_levels
[] = {
30 {DEBUG_WARNING
, "WARNING"},
31 {DEBUG_NOTICE
, "NOTICE"},
33 {DEBUG_DEBUG
, "DEBUG"},
37 const char *get_debug_by_level(int32_t level
)
41 for (i
=0; debug_levels
[i
].description
!= NULL
; i
++) {
42 if (debug_levels
[i
].level
== level
) {
43 return debug_levels
[i
].description
;
49 int32_t get_debug_by_desc(const char *desc
)
53 for (i
=0; debug_levels
[i
].description
!= NULL
; i
++) {
54 if (!strcasecmp(debug_levels
[i
].description
, desc
)) {
55 return debug_levels
[i
].level
;