nrfx_log.h 4.5 KB

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