From 5b366bcac8d915374b006f38c6afbae665e04764 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Tue, 1 May 2018 12:11:39 +0300 Subject: [PATCH] Add timestamps to debug prints --- src/TinyGsmCommon.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index ee71511..b803651 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -49,15 +49,23 @@ #ifdef TINY_GSM_DEBUG namespace { template - static void DBG(T last) { + static void DBG_PLAIN(T last) { TINY_GSM_DEBUG.println(last); } template - 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 + static void DBG(Args... args) { + TINY_GSM_DEBUG.print(GF("[")); + TINY_GSM_DEBUG.print(millis()); + TINY_GSM_DEBUG.print(GF("] ")); + DBG_PLAIN(args...); } } #else