introduced printf() specifiers for:
[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 #include <syslog.h>
27
28 #include <bus/bus.h>
29
30
31 typedef struct sys_logger_t sys_logger_t;
32
33 /**
34 * @brief Logger for syslog which implements bus_listener_t.
35 *
36 * @b Constructors:
37 * - sys_logger_create()
38 *
39 * @ingroup listeners
40 */
41 struct sys_logger_t {
42
43 /**
44 * Implements the bus_listener_t interface.
45 */
46 bus_listener_t listener;
47
48 /**
49 * @brief Set the loglevel for a signal type.
50 *
51 * @param this stream_logger_t object
52 * @param singal type of signal
53 * @param level max level to log
54 */
55 void (*set_level) (sys_logger_t *this, signal_t signal, level_t level);
56
57 /**
58 * @brief Destroys a sys_logger_t object.
59 *
60 * @param this sys_logger_t object
61 */
62 void (*destroy) (sys_logger_t *this);
63 };
64
65 /**
66 * @brief Constructor to create a sys_logger_t object.
67 *
68 * @param facility syslog facility to use
69 * @return sys_logger_t object
70 *
71 * @ingroup listeners
72 */
73 sys_logger_t *sys_logger_create(int facility);
74
75
76 #endif /* SYS_LOGGER_H_ */