mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
Add D_TIMESTAMP to lang.h
This commit is contained in:
parent
55d45f29c8
commit
8fbab678b3
@ -66,7 +66,7 @@ static void debugPrintTimestamp(int level, Print* _logOutput)
|
|||||||
unsigned long int milli = curTime.tv_usec / 1000;
|
unsigned long int milli = curTime.tv_usec / 1000;
|
||||||
char buffer[24];
|
char buffer[24];
|
||||||
// strftime(buffer, sizeof(buffer), "[%b %d %H:%M:%S", timeinfo); // Literal String
|
// strftime(buffer, sizeof(buffer), "[%b %d %H:%M:%S", timeinfo); // Literal String
|
||||||
strftime(buffer, sizeof(buffer), "[%H:%M:%S", timeinfo); // Literal String
|
strftime(buffer, sizeof(buffer), "[" D_TIMESTAMP, timeinfo); // Literal String
|
||||||
|
|
||||||
#ifdef ARDUINO
|
#ifdef ARDUINO
|
||||||
_logOutput->printf(PSTR("%s.%03lu]"), buffer, milli);
|
_logOutput->printf(PSTR("%s.%03lu]"), buffer, milli);
|
||||||
@ -78,9 +78,9 @@ static void debugPrintTimestamp(int level, Print* _logOutput)
|
|||||||
|
|
||||||
uint32_t msecs = millis();
|
uint32_t msecs = millis();
|
||||||
#ifdef ARDUINO
|
#ifdef ARDUINO
|
||||||
_logOutput->printf(PSTR("[%15d.%03d]"), msecs / 1000, msecs % 1000);
|
_logOutput->printf(PSTR("[" D_TIME_MILLIS ".%03d]"), msecs / 1000, msecs % 1000);
|
||||||
#else
|
#else
|
||||||
debug_print(_logOutput, PSTR("[%15d.%03d]"), msecs / 1000, msecs % 1000);
|
debug_print(_logOutput, PSTR("[" D_TIME_MILLIS ".%03d]"), msecs / 1000, msecs % 1000);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,7 @@
|
|||||||
#define D_BULLET " * "
|
#define D_BULLET " * "
|
||||||
#define D_MANUFACTURER "openHASP"
|
#define D_MANUFACTURER "openHASP"
|
||||||
|
|
||||||
|
#define D_TIMESTAMP "%H:%M:%S" // Used when reference time is set from NTP
|
||||||
|
#define D_TIME_MILLIS "%8d" // Used when no reference clock could be set
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user