Browse Source

Add timestamps to debug prints

v_master
Volodymyr Shymanskyy 6 years ago
parent
commit
5b366bcac8
1 changed files with 11 additions and 3 deletions
  1. +11
    -3
      src/TinyGsmCommon.h

+ 11
- 3
src/TinyGsmCommon.h View File

@ -49,15 +49,23 @@
#ifdef TINY_GSM_DEBUG
namespace {
template<typename T>
static void DBG(T last) {
static void DBG_PLAIN(T last) {
TINY_GSM_DEBUG.println(last);
}
template<typename T, typename... Args>
static void DBG(T head, Args... tail) {
static void DBG_PLAIN(T head, Args... tail) {
TINY_GSM_DEBUG.print(head);
TINY_GSM_DEBUG.print(' ');
DBG(tail...);
DBG_PLAIN(tail...);
}
template<typename... Args>
static void DBG(Args... args) {
TINY_GSM_DEBUG.print(GF("["));
TINY_GSM_DEBUG.print(millis());
TINY_GSM_DEBUG.print(GF("] "));
DBG_PLAIN(args...);
}
}
#else


Loading…
Cancel
Save