@@ -92,12 +92,10 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args);
92
92
#if defined(MP_PRN_LEVEL ) && (MP_PRN_LEVEL > 0 )
93
93
#define MP_PRN (level , ...) \
94
94
do { \
95
- if (MP_PRN_LEVEL > 0) { \
96
- if ((0 < level) && (level <= MP_PRN_LEVEL)) { \
97
- mp_printf(MP_PYTHON_PRINTER, "%d| ", level); \
98
- mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); \
99
- mp_printf(MP_PYTHON_PRINTER, "\n"); \
100
- } \
95
+ if ((0 < level) && (level <= MP_PRN_LEVEL)) { \
96
+ mp_printf(MP_PYTHON_PRINTER, " %d|| ", level); \
97
+ mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); \
98
+ mp_printf(MP_PYTHON_PRINTER, " ||%d %s\n", __LINE__, __FILE__); \
101
99
} \
102
100
} while (0);
103
101
#else
@@ -108,6 +106,7 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args);
108
106
// Set MP_PRN_LEVEL in developed *.C or *.CPP file, for example
109
107
110
108
#define MP_PRN_LEVEL 1000 // show all messages
109
+
111
110
// Add MP_PRN() macro in code, like
112
111
void foo() {
113
112
MP_PRN(6, "Enter foo()")
@@ -121,10 +120,9 @@ void foo() {
121
120
MP_PRN(6, "Exit foo()")
122
121
}
123
122
124
- // See usage in ports/esp32/esp32_pcnt.c and ports/esp32/machine_pwm.c
125
123
// It is not a dogma. You may start debugging from level 3.
126
124
#define MP_PRN_LEVEL 3
127
- // Then add MP_PRN(3, ...) and when gets too much messages then change some messages to the next level MP_PRN(4, ...), or MP_PRN(2, ...)
125
+ // Then add MP_PRN(3, ...) and when gets too much messages then change some messages to the next level MP_PRN(4, ...), or MP_PRN(2, ...) etc.
128
126
// Then you may change MP_PRN_LEVEL to 2(reduce printing), and finally to 0(supress printing).
129
127
*/
130
128
0 commit comments