diff --git a/components/esp-insights b/components/esp-insights index 8f767e4..c4e3c44 160000 --- a/components/esp-insights +++ b/components/esp-insights @@ -1 +1 @@ -Subproject commit 8f767e41c533c918aa73769f9b4243974db0c017 +Subproject commit c4e3c448b3a5e5e22392f8a1733ab6d45c69362a diff --git a/examples/common/app_insights/Kconfig b/examples/common/app_insights/Kconfig index 9a99ef3..19d6a56 100644 --- a/examples/common/app_insights/Kconfig +++ b/examples/common/app_insights/Kconfig @@ -3,9 +3,9 @@ visible if ESP_INSIGHTS_ENABLED config APP_INSIGHTS_ENABLE_LOG_TYPE_ALL bool "Enable all diagnostics log type" - default y + default n help - By default this enables error and event diagnostics log types. - This config option quickly disables the capture of all these log types. + By default only error logs are enabled. + This config option enables the capture of all log types (errors/warnings/events). endmenu diff --git a/examples/common/app_insights/app_insights.c b/examples/common/app_insights/app_insights.c index 84a0c8c..59509dc 100644 --- a/examples/common/app_insights/app_insights.c +++ b/examples/common/app_insights/app_insights.c @@ -10,18 +10,23 @@ #ifdef CONFIG_ESP_INSIGHTS_ENABLED #include #include -#include +#include +#include +#include #if CONFIG_APP_INSIGHTS_ENABLE_LOG_TYPE_ALL #define APP_INSIGHTS_LOG_TYPE ESP_DIAG_LOG_TYPE_ERROR \ + | ESP_DIAG_LOG_TYPE_WARNING \ | ESP_DIAG_LOG_TYPE_EVENT #else -#define APP_INSIGHTS_LOG_TYPE 0 +#define APP_INSIGHTS_LOG_TYPE ESP_DIAG_LOG_TYPE_ERROR #endif /* CONFIG_APP_INSIGHTS_ENABLE_LOG_TYPE_ALL */ +esp_err_t esp_insights_enable(esp_insights_config_t *config); + #endif /* CONFIG_ESP_INSIGHTS_ENABLED */ -static const char *TAG = "app_insights"; +#define TAG "app_insights" esp_err_t app_insights_enable(void) { @@ -49,12 +54,7 @@ esp_err_t app_insights_enable(void) esp_insights_config_t config = { .log_type = APP_INSIGHTS_LOG_TYPE, }; - esp_insights_rmaker_enable(&config); - ESP_LOGI(TAG, "App Insights Enabled."); -#ifdef CONFIG_DIAG_ENABLE_HEAP_METRICS - /* Dump heap metrics */ - esp_diag_heap_metrics_dump(); -#endif /* CONFIG_DIAG_ENABLE_HEAP_METRICS */ + esp_insights_enable(&config); #else ESP_LOGI(TAG, "Enable CONFIG_ESP_INSIGHTS_ENABLED to get Insights."); #endif /* ! CONFIG_ESP_INSIGHTS_ENABLED */