Annotation of embedaddon/strongswan/src/libcharon/bus/listeners/sys_logger.h, revision 1.1.1.2

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>