2 logging.h -- header for logging.c
3 Copyright (C) 2002 Guus Sliepen <guus@sliepen.warande.net>,
4 2002 Ivo Timmermans <ivo@o2w.nl>
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 2 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, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 $Id: logging.h,v 1.5 2002/04/13 10:50:48 zarq Exp $
23 #ifndef __TINC_LOGGING_H__
24 #define __TINC_LOGGING_H__
37 DEBUG_NOTHING = 0, /* Quiet mode, only show starting/stopping of the daemon */
38 DEBUG_CONNECTIONS = 1, /* Show (dis)connects of other tinc daemons via TCP */
39 DEBUG_ERROR = 2, /* Show error messages received from other hosts */
40 DEBUG_STATUS = 2, /* Show status messages received from other hosts */
41 DEBUG_PROTOCOL = 3, /* Show the requests that are sent/received */
42 DEBUG_META = 4, /* Show contents of every request that is sent/received */
43 DEBUG_TRAFFIC = 5, /* Show network traffic information */
44 DEBUG_PACKET = 6, /* Show contents of each packet that is being sent/received */
45 DEBUG_SCARY_THINGS = 10 /* You have been warned */
48 typedef void (log_function_t)(int,int,char*,va_list);
51 extern avl_tree_t *log_hooks_tree;
53 extern void log(int, int, char *, ...);
54 extern void log_add_hook(log_function_t *);
55 extern void log_del_hook(log_function_t *);
56 extern log_function_t log_default_hook;
57 extern void tinc_syslog(int, char *, ...);
59 #ifndef LOG_ERR /* Something from syslog.h */
60 # define syslog tinc_syslog
61 #define LOG_EMERG 0 /* system is unusable */
62 #define LOG_ALERT 1 /* action must be taken immediately */
63 #define LOG_CRIT 2 /* critical conditions */
64 #define LOG_ERR 3 /* error conditions */
65 #define LOG_WARNING 4 /* warning conditions */
66 #define LOG_NOTICE 5 /* normal but significant condition */
67 #define LOG_INFO 6 /* informational */
68 #define LOG_DEBUG 7 /* debug-level messages */
71 #endif /* __TINC_LOGGING_H__ */