#include "bool.h"
#include "config.h"
-#include "log.h"
+#include <plog.h>
#include "ptime.h"
#include "slog.h"
static const char *DEFAULT_FILENAME = "sensors.log";
+static char *time_to_str(time_t *t)
+{
+ struct tm lt;
+ char *str;
+
+ if (!localtime_r(t, <))
+ return NULL;
+
+ str = malloc(64);
+
+ if (strftime(str, 64, "%s", <)) {
+ return str;
+ } else {
+ free(str);
+ return NULL;
+ }
+}
+
static char *get_default_path()
{
char *home, *path, *dir;