Log the date/time and version in the example applications.

This commit is contained in:
Jef Driesen 2012-12-28 07:06:29 +01:00
parent f6df407699
commit 0e0168f4d4

View File

@ -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));
}
}