Log the date/time and version in the example applications.
This commit is contained in:
parent
f6df407699
commit
0e0168f4d4
@ -23,6 +23,9 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libdivecomputer/datetime.h>
|
||||
#include <libdivecomputer/version.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
static FILE* g_logfile = NULL;
|
||||
@ -90,5 +93,12 @@ void message_set_logfile (const char* filename)
|
||||
#else
|
||||
gettimeofday (&g_timestamp, NULL);
|
||||
#endif
|
||||
dc_datetime_t dt = {0};
|
||||
dc_ticks_t now = dc_datetime_now ();
|
||||
dc_datetime_gmtime (&dt, now);
|
||||
message ("DATETIME %u-%02u-%02uT%02u:%02u:%02uZ (%lu)\n",
|
||||
dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second,
|
||||
(unsigned long) now);
|
||||
message ("VERSION %s\n", dc_version (NULL));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user