1*150812a8SEvalZero /* 2*150812a8SEvalZero * Copyright (c) 2017 - 2018, Nordic Semiconductor ASA 3*150812a8SEvalZero * All rights reserved. 4*150812a8SEvalZero * 5*150812a8SEvalZero * Redistribution and use in source and binary forms, with or without 6*150812a8SEvalZero * modification, are permitted provided that the following conditions are met: 7*150812a8SEvalZero * 8*150812a8SEvalZero * 1. Redistributions of source code must retain the above copyright notice, this 9*150812a8SEvalZero * list of conditions and the following disclaimer. 10*150812a8SEvalZero * 11*150812a8SEvalZero * 2. Redistributions in binary form must reproduce the above copyright 12*150812a8SEvalZero * notice, this list of conditions and the following disclaimer in the 13*150812a8SEvalZero * documentation and/or other materials provided with the distribution. 14*150812a8SEvalZero * 15*150812a8SEvalZero * 3. Neither the name of the copyright holder nor the names of its 16*150812a8SEvalZero * contributors may be used to endorse or promote products derived from this 17*150812a8SEvalZero * software without specific prior written permission. 18*150812a8SEvalZero * 19*150812a8SEvalZero * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20*150812a8SEvalZero * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21*150812a8SEvalZero * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22*150812a8SEvalZero * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23*150812a8SEvalZero * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24*150812a8SEvalZero * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25*150812a8SEvalZero * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26*150812a8SEvalZero * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27*150812a8SEvalZero * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28*150812a8SEvalZero * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29*150812a8SEvalZero * POSSIBILITY OF SUCH DAMAGE. 30*150812a8SEvalZero */ 31*150812a8SEvalZero 32*150812a8SEvalZero #ifndef NRFX_LOG_H__ 33*150812a8SEvalZero #define NRFX_LOG_H__ 34*150812a8SEvalZero 35*150812a8SEvalZero // THIS IS A TEMPLATE FILE. 36*150812a8SEvalZero // It should be copied to a suitable location within the host environment into 37*150812a8SEvalZero // which nrfx is integrated, and the following macros should be provided with 38*150812a8SEvalZero // appropriate implementations. 39*150812a8SEvalZero // And this comment should be removed from the customized file. 40*150812a8SEvalZero 41*150812a8SEvalZero #ifdef __cplusplus 42*150812a8SEvalZero extern "C" { 43*150812a8SEvalZero #endif 44*150812a8SEvalZero 45*150812a8SEvalZero /** 46*150812a8SEvalZero * @defgroup nrfx_log nrfx_log.h 47*150812a8SEvalZero * @{ 48*150812a8SEvalZero * @ingroup nrfx 49*150812a8SEvalZero * 50*150812a8SEvalZero * @brief This file contains macros that should be implemented according to 51*150812a8SEvalZero * the needs of the host environment into which @em nrfx is integrated. 52*150812a8SEvalZero */ 53*150812a8SEvalZero 54*150812a8SEvalZero /** 55*150812a8SEvalZero * @brief Macro for logging a message with the severity level ERROR. 56*150812a8SEvalZero * 57*150812a8SEvalZero * @param format printf-style format string, optionally followed by arguments 58*150812a8SEvalZero * to be formatted and inserted in the resulting string. 59*150812a8SEvalZero */ 60*150812a8SEvalZero #define NRFX_LOG_ERROR(format, ...) 61*150812a8SEvalZero 62*150812a8SEvalZero /** 63*150812a8SEvalZero * @brief Macro for logging a message with the severity level WARNING. 64*150812a8SEvalZero * 65*150812a8SEvalZero * @param format printf-style format string, optionally followed by arguments 66*150812a8SEvalZero * to be formatted and inserted in the resulting string. 67*150812a8SEvalZero */ 68*150812a8SEvalZero #define NRFX_LOG_WARNING(format, ...) 69*150812a8SEvalZero 70*150812a8SEvalZero /** 71*150812a8SEvalZero * @brief Macro for logging a message with the severity level INFO. 72*150812a8SEvalZero * 73*150812a8SEvalZero * @param format printf-style format string, optionally followed by arguments 74*150812a8SEvalZero * to be formatted and inserted in the resulting string. 75*150812a8SEvalZero */ 76*150812a8SEvalZero #define NRFX_LOG_INFO(format, ...) 77*150812a8SEvalZero 78*150812a8SEvalZero /** 79*150812a8SEvalZero * @brief Macro for logging a message with the severity level DEBUG. 80*150812a8SEvalZero * 81*150812a8SEvalZero * @param format printf-style format string, optionally followed by arguments 82*150812a8SEvalZero * to be formatted and inserted in the resulting string. 83*150812a8SEvalZero */ 84*150812a8SEvalZero #define NRFX_LOG_DEBUG(format, ...) 85*150812a8SEvalZero 86*150812a8SEvalZero 87*150812a8SEvalZero /** 88*150812a8SEvalZero * @brief Macro for logging a memory dump with the severity level ERROR. 89*150812a8SEvalZero * 90*150812a8SEvalZero * @param[in] p_memory Pointer to the memory region to be dumped. 91*150812a8SEvalZero * @param[in] length Length of the memory region in bytes. 92*150812a8SEvalZero */ 93*150812a8SEvalZero #define NRFX_LOG_HEXDUMP_ERROR(p_memory, length) 94*150812a8SEvalZero 95*150812a8SEvalZero /** 96*150812a8SEvalZero * @brief Macro for logging a memory dump with the severity level WARNING. 97*150812a8SEvalZero * 98*150812a8SEvalZero * @param[in] p_memory Pointer to the memory region to be dumped. 99*150812a8SEvalZero * @param[in] length Length of the memory region in bytes. 100*150812a8SEvalZero */ 101*150812a8SEvalZero #define NRFX_LOG_HEXDUMP_WARNING(p_memory, length) 102*150812a8SEvalZero 103*150812a8SEvalZero /** 104*150812a8SEvalZero * @brief Macro for logging a memory dump with the severity level INFO. 105*150812a8SEvalZero * 106*150812a8SEvalZero * @param[in] p_memory Pointer to the memory region to be dumped. 107*150812a8SEvalZero * @param[in] length Length of the memory region in bytes. 108*150812a8SEvalZero */ 109*150812a8SEvalZero #define NRFX_LOG_HEXDUMP_INFO(p_memory, length) 110*150812a8SEvalZero 111*150812a8SEvalZero /** 112*150812a8SEvalZero * @brief Macro for logging a memory dump with the severity level DEBUG. 113*150812a8SEvalZero * 114*150812a8SEvalZero * @param[in] p_memory Pointer to the memory region to be dumped. 115*150812a8SEvalZero * @param[in] length Length of the memory region in bytes. 116*150812a8SEvalZero */ 117*150812a8SEvalZero #define NRFX_LOG_HEXDUMP_DEBUG(p_memory, length) 118*150812a8SEvalZero 119*150812a8SEvalZero 120*150812a8SEvalZero /** 121*150812a8SEvalZero * @brief Macro for getting the textual representation of a given error code. 122*150812a8SEvalZero * 123*150812a8SEvalZero * @param[in] error_code Error code. 124*150812a8SEvalZero * 125*150812a8SEvalZero * @return String containing the textual representation of the error code. 126*150812a8SEvalZero */ 127*150812a8SEvalZero #define NRFX_LOG_ERROR_STRING_GET(error_code) 128*150812a8SEvalZero 129*150812a8SEvalZero /** @} */ 130*150812a8SEvalZero 131*150812a8SEvalZero #ifdef __cplusplus 132*150812a8SEvalZero } 133*150812a8SEvalZero #endif 134*150812a8SEvalZero 135*150812a8SEvalZero #endif // NRFX_LOG_H__ 136