diff options
author | Martin Schwenke <martin@meltin.net> | 2014-09-09 13:52:07 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-09-10 01:36:15 +0200 |
commit | 97dc127b81c1923755b59aad6e735aa679af3f64 (patch) | |
tree | 08624532475f7745583ad252246045c051779f19 | |
parent | 01598ce18d7980a3aa13314e943a5d82bdcbd672 (diff) | |
download | samba-97dc127b81c1923755b59aad6e735aa679af3f64.tar.gz samba-97dc127b81c1923755b59aad6e735aa679af3f64.tar.xz samba-97dc127b81c1923755b59aad6e735aa679af3f64.zip |
ctdb-logging: Factor out ctdb_logging.h from includes.h
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | ctdb/include/ctdb_logging.h | 41 | ||||
-rw-r--r-- | ctdb/include/internal/includes.h | 18 |
2 files changed, 42 insertions, 17 deletions
diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h new file mode 100644 index 0000000000..a3be3a8433 --- /dev/null +++ b/ctdb/include/ctdb_logging.h @@ -0,0 +1,41 @@ +/* + 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_ + +extern int LogLevel; +extern int this_log_level; + +enum debug_level { + DEBUG_EMERG = -3, + DEBUG_ALERT = -2, + DEBUG_CRIT = -1, + DEBUG_ERR = 0, + DEBUG_WARNING = 1, + DEBUG_NOTICE = 2, + DEBUG_INFO = 3, + DEBUG_DEBUG = 4, +}; + +#define DEBUGLVL(lvl) ((lvl) <= LogLevel) +#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0) +#define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0) + +#endif /* _CTDB_LOGGING_H_ */ diff --git a/ctdb/include/internal/includes.h b/ctdb/include/internal/includes.h index 9217dbd906..e3e153b9a9 100644 --- a/ctdb/include/internal/includes.h +++ b/ctdb/include/internal/includes.h @@ -18,23 +18,7 @@ #include "tevent.h" -extern int LogLevel; -extern int this_log_level; - -enum debug_level { - DEBUG_EMERG = -3, - DEBUG_ALERT = -2, - DEBUG_CRIT = -1, - DEBUG_ERR = 0, - DEBUG_WARNING = 1, - DEBUG_NOTICE = 2, - DEBUG_INFO = 3, - DEBUG_DEBUG = 4, -}; - -#define DEBUGLVL(lvl) ((lvl) <= LogLevel) -#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0) -#define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0) +#include "ctdb_logging.h" #ifndef _PUBLIC_ #define _PUBLIC_ |