@@ -58,11 +58,14 @@ void Arduino_DebugUtils::timestampOff() {
58
58
_timestamp_on = false ;
59
59
}
60
60
61
- void Arduino_DebugUtils::print (int const debug_level, const char * fmt, ...) {
61
+ void Arduino_DebugUtils::print (int const debug_level, const char * fmt, ...)
62
+ {
62
63
if (debug_level >= DBG_ERROR &&
63
64
debug_level <= DBG_VERBOSE &&
64
- debug_level <= _debug_level) {
65
- if (_timestamp_on) {
65
+ debug_level <= _debug_level)
66
+ {
67
+ if (_timestamp_on)
68
+ {
66
69
char timestamp[20 ];
67
70
snprintf (timestamp, 20 , " [ %lu ] " , millis ());
68
71
_debug_output_stream->print (timestamp);
@@ -75,6 +78,28 @@ void Arduino_DebugUtils::print(int const debug_level, const char * fmt, ...) {
75
78
}
76
79
}
77
80
81
+ void Arduino_DebugUtils::print (int const debug_level, const __FlashStringHelper * fmt, ...)
82
+ {
83
+ if (debug_level >= DBG_ERROR &&
84
+ debug_level <= DBG_VERBOSE &&
85
+ debug_level <= _debug_level)
86
+ {
87
+ if (_timestamp_on)
88
+ {
89
+ char timestamp[20 ];
90
+ snprintf (timestamp, 20 , " [ %lu ] " , millis ());
91
+ _debug_output_stream->print (timestamp);
92
+ }
93
+
94
+ String fmt_str (fmt);
95
+
96
+ va_list args;
97
+ va_start (args, fmt_str.c_str ());
98
+ vPrint (fmt_str.c_str (), args);
99
+ va_end (args);
100
+ }
101
+ }
102
+
78
103
/* *****************************************************************************
79
104
PRIVATE MEMBER FUNCTIONS
80
105
******************************************************************************/
0 commit comments