Moving charon to libcharon.
[strongswan.git] / src / libcharon / bus / listeners / file_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
16 /**
17 * @defgroup file_logger file_logger
18 * @{ @ingroup listeners
19 */
20
21 #ifndef FILE_LOGGER_H_
22 #define FILE_LOGGER_H_
23
24 #include <bus/listeners/listener.h>
25
26 typedef struct file_logger_t file_logger_t;
27
28 /**
29 * Logger to files which implements listener_t.
30 */
31 struct file_logger_t {
32
33 /**
34 * Implements the listener_t interface.
35 */
36 listener_t listener;
37
38 /**
39 * Set the loglevel for a debug group.
40 *
41 * @param group debug group to set
42 * @param level max level to log (0..4)
43 */
44 void (*set_level) (file_logger_t *this, debug_t group, level_t level);
45
46 /**
47 * Destroys a file_logger_t object.
48 */
49 void (*destroy) (file_logger_t *this);
50 };
51
52 /**
53 * Constructor to create a file_logger_t object.
54 *
55 * @param out FILE to write to
56 * @return file_logger_t object
57 */
58 file_logger_t *file_logger_create(FILE *out);
59
60 #endif /** FILE_LOGGER_H_ @}*/