1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/include/ctdb_logging.h
Martin Schwenke b4589b954e ctdb-logging: Update to use Samba style debug.h/debug.c
Samba's debug subsystem has changed a lot, so CTDB's logging needs
to be rewritten to be compatible.

The new debug.h/debug.c can't just be pulled in because it has some
extra dependencies into Samba's lib/util.  For now, to support the
smallest possible patch, implement a minimal subset of Samba's
debug.[ch] that just supports the DEBUG_CALLBACK logtype.

Define a callback for each logging method.

Check later to see if debug_extra (or similar) can somehow be
implemented using debug classes.

The timestamp on CTDB CLI tool and test program DEBUG() output goes
away, so update the unit test code to cope.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-10-06 12:34:33 +02:00

37 lines
1015 B
C

/*
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 const char *debug_extra;
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,
};
#endif /* _CTDB_LOGGING_H_ */