Skip to content

Commit d16eff0

Browse files
committed
Merge branch 'task/insights_api_change' into 'master'
esp_insights: Update submodule and minor fixes See merge request app-frameworks/esp-rainmaker!258
2 parents fb4fa54 + dc65f11 commit d16eff0

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

components/esp-insights

examples/common/app_insights/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ visible if ESP_INSIGHTS_ENABLED
33

44
config APP_INSIGHTS_ENABLE_LOG_TYPE_ALL
55
bool "Enable all diagnostics log type"
6-
default y
6+
default n
77
help
8-
By default this enables error and event diagnostics log types.
9-
This config option quickly disables the capture of all these log types.
8+
By default only error logs are enabled.
9+
This config option enables the capture of all log types (errors/warnings/events).
1010

1111
endmenu

examples/common/app_insights/app_insights.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@
1010
#ifdef CONFIG_ESP_INSIGHTS_ENABLED
1111
#include <esp_rmaker_mqtt.h>
1212
#include <esp_insights.h>
13-
#include <esp_diagnostics_system_metrics.h>
13+
#include <string.h>
14+
#include <esp_rmaker_core.h>
15+
#include <esp_rmaker_factory.h>
1416

1517
#if CONFIG_APP_INSIGHTS_ENABLE_LOG_TYPE_ALL
1618
#define APP_INSIGHTS_LOG_TYPE ESP_DIAG_LOG_TYPE_ERROR \
19+
| ESP_DIAG_LOG_TYPE_WARNING \
1720
| ESP_DIAG_LOG_TYPE_EVENT
1821
#else
19-
#define APP_INSIGHTS_LOG_TYPE 0
22+
#define APP_INSIGHTS_LOG_TYPE ESP_DIAG_LOG_TYPE_ERROR
2023
#endif /* CONFIG_APP_INSIGHTS_ENABLE_LOG_TYPE_ALL */
2124

25+
esp_err_t esp_insights_enable(esp_insights_config_t *config);
26+
2227
#endif /* CONFIG_ESP_INSIGHTS_ENABLED */
2328

24-
static const char *TAG = "app_insights";
29+
#define TAG "app_insights"
2530

2631
esp_err_t app_insights_enable(void)
2732
{
@@ -49,12 +54,7 @@ esp_err_t app_insights_enable(void)
4954
esp_insights_config_t config = {
5055
.log_type = APP_INSIGHTS_LOG_TYPE,
5156
};
52-
esp_insights_rmaker_enable(&config);
53-
ESP_LOGI(TAG, "App Insights Enabled.");
54-
#ifdef CONFIG_DIAG_ENABLE_HEAP_METRICS
55-
/* Dump heap metrics */
56-
esp_diag_heap_metrics_dump();
57-
#endif /* CONFIG_DIAG_ENABLE_HEAP_METRICS */
57+
esp_insights_enable(&config);
5858
#else
5959
ESP_LOGI(TAG, "Enable CONFIG_ESP_INSIGHTS_ENABLED to get Insights.");
6060
#endif /* ! CONFIG_ESP_INSIGHTS_ENABLED */

0 commit comments

Comments
 (0)