moved typedefs to beginning of files to solve some include problems
[strongswan.git] / src / charon / bus / listeners / sys_logger.h
1 /**
2 * @file sys_logger.h
3 *
4 * @brief Interface of sys_logger_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
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 * @brief Logger for syslog which implements bus_listener_t.
34 *
35 * @b Constructors:
36 * - sys_logger_create()
37 *
38 * @ingroup listeners
39 */
40 struct sys_logger_t {
41
42 /**
43 * Implements the bus_listener_t interface.
44 */
45 bus_listener_t listener;
46
47 /**
48 * @brief Set the loglevel for a signal type.
49 *
50 * @param this stream_logger_t object
51 * @param singal type of signal
52 * @param level max level to log
53 */
54 void (*set_level) (sys_logger_t *this, signal_t signal, level_t level);
55
56 /**
57 * @brief Destroys a sys_logger_t object.
58 *
59 * @param this sys_logger_t object
60 */
61 void (*destroy) (sys_logger_t *this);
62 };
63
64 /**
65 * @brief Constructor to create a sys_logger_t object.
66 *
67 * @param facility syslog facility to use
68 * @return sys_logger_t object
69 *
70 * @ingroup listeners
71 */
72 sys_logger_t *sys_logger_create(int facility);
73
74
75 #endif /* SYS_LOGGER_H_ */