2021-05-21 03:52:25 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* This is a STUB FILE HEADER used when compiling ESP-IDF to run tests on the host system.
|
|
|
|
* The header file used normally for ESP-IDF has the same name but is located elsewhere.
|
|
|
|
*/
|
2018-05-26 02:58:01 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2022-01-17 04:44:25 -05:00
|
|
|
#include <stdbool.h>
|
2018-05-26 02:58:01 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2018-06-21 04:51:44 -04:00
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
2018-05-26 02:58:01 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-06-21 04:51:44 -04:00
|
|
|
#define heap_caps_malloc(a, b) NULL
|
|
|
|
#define MALLOC_CAP_INTERNAL 0
|
|
|
|
#define MALLOC_CAP_8BIT 0
|
|
|
|
|
|
|
|
#define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL
|
2018-05-26 02:58:01 -04:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ESP_LOG_NONE, /*!< No log output */
|
|
|
|
ESP_LOG_ERROR, /*!< Critical errors, software module can not recover on its own */
|
|
|
|
ESP_LOG_WARN, /*!< Error conditions from which recovery measures have been taken */
|
|
|
|
ESP_LOG_INFO, /*!< Information messages which describe normal flow of events */
|
|
|
|
ESP_LOG_DEBUG, /*!< Extra information which is not necessary for normal use (values, pointers, sizes, etc). */
|
|
|
|
ESP_LOG_VERBOSE /*!< Bigger chunks of debugging information, or frequent messages which can potentially flood the output. */
|
|
|
|
} esp_log_level_t;
|
|
|
|
|
|
|
|
#define LOG_COLOR_E
|
|
|
|
#define LOG_COLOR_W
|
|
|
|
#define LOG_COLOR_I
|
|
|
|
#define LOG_COLOR_D
|
|
|
|
#define LOG_COLOR_V
|
|
|
|
#define LOG_RESET_COLOR
|
|
|
|
|
2018-06-21 04:51:44 -04:00
|
|
|
#undef _Static_assert
|
|
|
|
#define _Static_assert(cond, message)
|
|
|
|
|
2018-05-26 02:58:01 -04:00
|
|
|
uint32_t esp_log_timestamp(void);
|
|
|
|
void esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
|
|
|
|
|
|
|
|
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n"
|
|
|
|
|
|
|
|
#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); }
|
|
|
|
|
2018-06-07 06:32:37 -04:00
|
|
|
#define ESP_LOGW( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_WARN) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); }
|
|
|
|
|
2021-05-21 03:51:06 -04:00
|
|
|
#define ESP_LOGI( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); }
|
2018-05-26 02:58:01 -04:00
|
|
|
|
|
|
|
#define ESP_LOGD( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_DEBUG) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); }
|
|
|
|
|
2018-06-07 06:32:37 -04:00
|
|
|
#define ESP_LOGV( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_VERBOSE) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); }
|
2018-05-26 02:58:01 -04:00
|
|
|
|
2022-01-28 12:16:13 -05:00
|
|
|
#define esp_flash_encryption_enabled() false
|
2018-05-26 02:58:01 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|