added logging to file in cron application

This commit is contained in:
Bogdan Pilyugin 2023-05-08 10:31:22 +02:00
parent 58f0d62c6c
commit 2d9f3d5bfe
2 changed files with 4 additions and 1 deletions

@ -1 +1 @@
Subproject commit 832bd3e6236fc7eb9fe3a02b2625bd4dee0c2444 Subproject commit 918ac98b3589a8462553cbe70d89e8adf744a24b

View File

@ -22,6 +22,7 @@
#include "CronTimers.h" #include "CronTimers.h"
#include "AppConfiguration.h" #include "AppConfiguration.h"
#include "esp_log.h" #include "esp_log.h"
#include "webguiapp.h"
#define TAG "CRON_TIMER" #define TAG "CRON_TIMER"
@ -57,6 +58,7 @@ void custom_cron_job_callback(cron_job *job)
time_t now; time_t now;
time(&now); time(&now);
ESP_LOGI(TAG, "Execute scheduler '%s' action %d under object %d at time %d", name, act, obj, (unsigned int )now); ESP_LOGI(TAG, "Execute scheduler '%s' action %d under object %d at time %d", name, act, obj, (unsigned int )now);
LogFile("cron.log", "executed sheduler");
custom_cron_execute(obj, act); custom_cron_execute(obj, act);
return; return;
} }
@ -121,6 +123,7 @@ void TimeObtainHandler(struct timeval *tm)
ESP_LOGW(TAG, "Current time received with value %d", (unsigned int )tm->tv_sec); ESP_LOGW(TAG, "Current time received with value %d", (unsigned int )tm->tv_sec);
ReloadCronSheduler(); ReloadCronSheduler();
ExecuteLastAction(); ExecuteLastAction();
LogFile("cron.log", "Cron service started");
} }
void DebugTimer() void DebugTimer()