Annotation of embedaddon/strongswan/src/libcharon/bus/listeners/custom_logger.h, revision 1.1
1.1 ! misho 1: /*
! 2: * Copyright (C) 2016 secunet Security Networks AG
! 3: * Copyright (C) 2016 Thomas Egerer
! 4: *
! 5: * Permission is hereby granted, free of charge, to any person obtaining a copy
! 6: * of this software and associated documentation files (the "Software"), to deal
! 7: * in the Software without restriction, including without limitation the rights
! 8: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! 9: * copies of the Software, and to permit persons to whom the Software is
! 10: * furnished to do so, subject to the following conditions:
! 11: *
! 12: * The above copyright notice and this permission notice shall be included in
! 13: * all copies or substantial portions of the Software.
! 14: *
! 15: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
! 16: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! 17: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! 18: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! 19: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! 20: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
! 21: * THE SOFTWARE.
! 22: */
! 23:
! 24: /**
! 25: * @defgroup custom_logger custom_logger
! 26: * @{ @ingroup listeners
! 27: */
! 28:
! 29: #ifndef CUSTOM_LOGGER_H_
! 30: #define CUSTOM_LOGGER_H_
! 31:
! 32: #include <bus/listeners/logger.h>
! 33:
! 34: typedef struct custom_logger_t custom_logger_t;
! 35:
! 36: /**
! 37: * Custom logger which implements listener_t.
! 38: */
! 39: struct custom_logger_t {
! 40:
! 41: /**
! 42: * Implements the logger_t interface.
! 43: */
! 44: logger_t logger;
! 45:
! 46: /**
! 47: * Set the loglevel for a debug group.
! 48: *
! 49: * @param group debug group to set
! 50: * @param level max level to log (0..4)
! 51: */
! 52: void (*set_level)(custom_logger_t *this, debug_t group, level_t level);
! 53:
! 54: /**
! 55: * Reload custom logger configuration.
! 56: */
! 57: void (*reload)(custom_logger_t *this);
! 58:
! 59: /**
! 60: * Destroy the custom_logger_t object.
! 61: */
! 62: void (*destroy)(custom_logger_t *this);
! 63: };
! 64:
! 65: /**
! 66: * Prototype for custom logger construction function pointer.
! 67: */
! 68: typedef custom_logger_t *(*custom_logger_constructor_t)(const char *name);
! 69:
! 70: #endif /** CUSTOM_LOGGER_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>