I was not satisfied with the previous debugging options structure. Improve it again.

This commit is contained in:
Dirk Ziegelmeier 2017-01-02 19:50:46 +01:00
parent 644a21b8a5
commit 4059748b47
2 changed files with 20 additions and 11 deletions

View File

@ -41,12 +41,12 @@
#include "lwip/opt.h" #include "lwip/opt.h"
/** /**
* @defgroup debugging Debugging * @defgroup debugging_levels LWIP_DBG_MIN_LEVEL and LWIP_DBG_TYPES_ON values
* @ingroup lwip * @ingroup lwip_opts_debugmsg
* @{ * @{
*/ */
/** @name Debug level /** @name Debug level (LWIP_DBG_MIN_LEVEL)
* @{ * @{
*/ */
/** Debug level: ALL messages*/ /** Debug level: ALL messages*/
@ -65,7 +65,7 @@
/* compatibility define only */ /* compatibility define only */
#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL #define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL
/** @name Enable/disable debug messages completely /** @name Enable/disable debug messages completely (LWIP_DBG_TYPES_ON)
* @{ * @{
*/ */
/** flag for LWIP_DEBUGF to enable that debug message */ /** flag for LWIP_DEBUGF to enable that debug message */
@ -76,7 +76,7 @@
* @} * @}
*/ */
/** @name Debug message types /** @name Debug message types (LWIP_DBG_TYPES_ON)
* @{ * @{
*/ */
/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ /** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
@ -91,6 +91,15 @@
* @} * @}
*/ */
/**
* @}
*/
/**
* @defgroup lwip_assertions Assertion handling
* @ingroup lwip_opts_debug
* @{
*/
/** /**
* LWIP_NOASSERT: Disable LWIP_ASSERT checks: * LWIP_NOASSERT: Disable LWIP_ASSERT checks:
* To disable assertions define LWIP_NOASSERT in arch/cc.h. * To disable assertions define LWIP_NOASSERT in arch/cc.h.
@ -99,6 +108,9 @@
#define LWIP_NOASSERT #define LWIP_NOASSERT
#undef LWIP_NOASSERT #undef LWIP_NOASSERT
#endif #endif
/**
* @}
*/
#ifndef LWIP_NOASSERT #ifndef LWIP_NOASSERT
#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \ #define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
@ -126,7 +138,6 @@
/** Enable debug message printing, but only if debug message type is enabled /** Enable debug message printing, but only if debug message type is enabled
* AND is of correct type AND is at least LWIP_DBG_LEVEL. * AND is of correct type AND is at least LWIP_DBG_LEVEL.
* e.g. \#define LWIP_DEBUG (LWIP_DBG_ON | LWIP_DBG_LEVEL_ALL | LWIP_DBG_TRACE)
*/ */
#ifdef __DOXYGEN__ #ifdef __DOXYGEN__
#define LWIP_DEBUG #define LWIP_DEBUG
@ -153,8 +164,4 @@
#define LWIP_DEBUGF(debug, message) #define LWIP_DEBUGF(debug, message)
#endif /* LWIP_DEBUG */ #endif /* LWIP_DEBUG */
/**
* @}
*/
#endif /* LWIP_HDR_DEBUG_H */ #endif /* LWIP_HDR_DEBUG_H */

View File

@ -2594,7 +2594,7 @@
--------------------------------------- ---------------------------------------
*/ */
/** /**
* @defgroup lwip_opts_debugmsg Debugging * @defgroup lwip_opts_debugmsg Debug messages
* @ingroup lwip_opts_debug * @ingroup lwip_opts_debug
* @{ * @{
*/ */
@ -2602,6 +2602,7 @@
* LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
* compared against this value. If it is smaller, then debugging * compared against this value. If it is smaller, then debugging
* messages are written. * messages are written.
* @see debugging_levels
*/ */
#if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__ #if !defined LWIP_DBG_MIN_LEVEL || defined __DOXYGEN__
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL #define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
@ -2610,6 +2611,7 @@
/** /**
* LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
* debug messages of certain types. * debug messages of certain types.
* @see debugging_levels
*/ */
#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON #define LWIP_DBG_TYPES_ON LWIP_DBG_ON