diff --git a/tutorials/device-dashboard/mongoose_app.c b/tutorials/device-dashboard/mongoose_app.c index 9e47d141..f493fac8 100644 --- a/tutorials/device-dashboard/mongoose_app.c +++ b/tutorials/device-dashboard/mongoose_app.c @@ -51,17 +51,21 @@ static void sync_metrics(bool is_write) { // Read-write device settings static double s_volume = 17.2; +static int s_log_level = MG_LL_DEBUG; static char s_name[20] = "Dublin"; static struct mg_field fields_settings[] = { {"volume", MG_VAL_DBL, &s_volume, sizeof(s_volume)}, {"name", MG_VAL_STR, &s_name, sizeof(s_name)}, + {"log_level", MG_VAL_INT, &s_log_level, sizeof(s_log_level)}, {NULL, 0, NULL, 0}, }; static void sync_settings(bool is_write) { if (is_write) { + mg_log_level = s_log_level; } else { + s_log_level = mg_log_level; } } diff --git a/tutorials/device-dashboard/web_root/index.html b/tutorials/device-dashboard/web_root/index.html index f626872a..84a32ea8 100644 --- a/tutorials/device-dashboard/web_root/index.html +++ b/tutorials/device-dashboard/web_root/index.html @@ -17,7 +17,7 @@ }, settings: { volume: 12, - motor: false, + log_level: 3, name: 'Galway', }, metrics: { @@ -211,12 +211,22 @@