e746fce82b60964fceca9ef5455556bddeb98049
[strongswan.git] / src / charon / bus / listeners / sys_logger.h
1 /*
2 * Copyright (C) 2006 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 /**
19 * @defgroup sys_logger sys_logger
20 * @{ @ingroup listeners
21 */
22
23 #ifndef SYS_LOGGER_H_
24 #define SYS_LOGGER_H_
25
26 typedef struct sys_logger_t sys_logger_t;
27
28 #include <syslog.h>
29
30 #include <bus/bus.h>
31
32 /**
33 * Logger for syslog which implements listener_t.
34 */
35 struct sys_logger_t {
36
37 /**
38 * Implements the listener_t interface.
39 */
40 listener_t listener;
41
42 /**
43 * Set the loglevel for a debug group.
44 *
45 * @param group debug group to set
46 * @param level max level to log (0..4)
47 */
48 void (*set_level) (sys_logger_t *this, debug_t group, level_t level);
49
50 /**
51 * Destroys a sys_logger_t object.
52 */
53 void (*destroy) (sys_logger_t *this);
54 };
55
56 /**
57 * Constructor to create a sys_logger_t object.
58 *
59 * @param facility syslog facility to use
60 * @return sys_logger_t object
61 */
62 sys_logger_t *sys_logger_create(int facility);
63
64 #endif /* SYS_LOGGER_H_ @} */