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 int DEBUGLEVEL
= DEBUG_NOTICE
;
27 int this_log_level
= 0;
28 const char *debug_extra
= "";
30 struct debug_levels debug_levels
[] = {
31 {DEBUG_EMERG
, "EMERG"},
32 {DEBUG_ALERT
, "ALERT"},
35 {DEBUG_WARNING
, "WARNING"},
36 {DEBUG_NOTICE
, "NOTICE"},
38 {DEBUG_DEBUG
, "DEBUG"},
42 const char *get_debug_by_level(int32_t level
)
46 for (i
=0; debug_levels
[i
].description
!= NULL
; i
++) {
47 if (debug_levels
[i
].level
== level
) {
48 return debug_levels
[i
].description
;
54 int32_t get_debug_by_desc(const char *desc
)
58 for (i
=0; debug_levels
[i
].description
!= NULL
; i
++) {
59 if (!strcasecmp(debug_levels
[i
].description
, desc
)) {
60 return debug_levels
[i
].level
;