You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add gaps between MP_DEBUG_PRINT_XXX levels.
Move `How to use:` upper before #define MP_DEBUG_PRINT().
Print level names instead of the numbers.
Signed-off-by: Ihor Nehrutsa <IhorNehrutsa@gmail.com>
// Debug messages during code developing with MP_DEBUG_PRINT(level, ...) & MP_DEBUG_PRINT_LEVEL.
83
83
// An approximate hierarchy of debug levels MP_DEBUG_PRINT_LEVEL is:
84
84
#defineMP_DEBUG_PRINT_SUPPRESS 0 // SUPPRESS all messages. Use it in the release version.
85
-
#defineMP_DEBUG_PRINT_CRITICAL1 // For the most CRITICAL errors, often requiring a system reset. Use a message with this level, if possible, raising an exception.
86
-
#defineMP_DEBUG_PRINT_ERROR2 // ERROR requiring program restart, use message with this level before raising an exception.
87
-
#defineMP_DEBUG_PRINT_WARNING3 // WARNING, something went wrong, but you can fix it with additional operations in code right now or may ignore it.
88
-
#defineMP_DEBUG_PRINT_INFO4 // INFO, it is interesting and useful for understanding a bug.
89
-
#defineMP_DEBUG_PRINT_DEBUG5 // DEBUG, more detailed information, dig deeper.
90
-
#defineMP_DEBUG_PRINT_TRACE6 // TRACE, show a flow of the algorithm, like enter/exit a function.
85
+
#defineMP_DEBUG_PRINT_CRITICAL10 // For the most CRITICAL errors, often requiring a system reset. Use a message with this level, if possible, raising an exception.
86
+
#defineMP_DEBUG_PRINT_ERROR20 // ERROR requiring program restart, use message with this level before raising an exception.
87
+
#defineMP_DEBUG_PRINT_WARNING30 // WARNING, something went wrong, but you can fix it with additional operations in code right now or may ignore it.
88
+
#defineMP_DEBUG_PRINT_INFO40 // INFO, it is interesting and useful for understanding a bug.
89
+
#defineMP_DEBUG_PRINT_DEBUG50 // DEBUG, more detailed information, dig deeper.
90
+
#defineMP_DEBUG_PRINT_TRACE60 // TRACE, show a flow of the algorithm, like enter/exit a function.
91
91
// In reality, you may use your own classification of debug levels.
92
92
93
93
#endif// MICROPY_INCLUDED_PY_MPPRINT_H
94
94
95
95
// This code is placed after `#endif // MICROPY_INCLUDED_PY_MPPRINT_H` to allow the developer
96
96
// to use several local `MP_DEBUG_PRINT_LEVEL` definitions in separate _.c files.
// It is not a dogma. You may start debugging from level 3.
143
-
#define MP_DEBUG_PRINT_LEVEL 3
144
-
// Then add MP_DEBUG_PRINT(3, ...) and when gets too many messages then change some messages to the next level MP_DEBUG_PRINT(4, ...), or MP_DEBUG_PRINT(2, ...) etc.
145
-
// Then you may change MP_DEBUG_PRINT_LEVEL to 2(reduce printing), and finally to 0(suppress printing).
130
+
// It is not a dogma. You may start debugging from level 30.
131
+
#define MP_DEBUG_PRINT_LEVEL 30
132
+
// Then add MP_DEBUG_PRINT(30, ...) and when gets too many messages then change some messages to the next level MP_DEBUG_PRINT(40, ...), or MP_DEBUG_PRINT(20, ...) etc.
133
+
// Then you may change MP_DEBUG_PRINT_LEVEL to 20(reduce printing), and finally to 0(suppress printing).
146
134
147
135
// Usually, you will debug one or two source files. Debug printing from other files is suppressed if MP_DEBUG_PRINT_LEVEL is 0 or undefined.
0 commit comments