VSF Documented
esp_log_buffer.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2026 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/*
19 * Clean-room re-implementation of ESP-IDF public API "esp_log_buffer.h".
20 *
21 * Baseline: ESP-IDF v5.1 public API.
22 */
23
24#ifndef __VSF_ESPIDF_ESP_LOG_BUFFER_H__
25#define __VSF_ESPIDF_ESP_LOG_BUFFER_H__
26
27#include <stdint.h>
28#include "esp_log.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34void esp_log_buffer_hex_internal(const char *tag, const void *buffer,
35 uint16_t buff_len, esp_log_level_t level);
36void esp_log_buffer_char_internal(const char *tag, const void *buffer,
37 uint16_t buff_len, esp_log_level_t level);
38void esp_log_buffer_hexdump_internal(const char *tag, const void *buffer,
39 uint16_t buff_len, esp_log_level_t log_level);
40
41#define ESP_LOG_BUFFER_HEX_LEVEL(tag, buffer, buff_len, level) \
42 do { if (ESP_LOG_ENABLED(level)) { \
43 esp_log_buffer_hex_internal(tag, buffer, buff_len, level); } } while(0)
44
45#define ESP_LOG_BUFFER_CHAR_LEVEL(tag, buffer, buff_len, level) \
46 do { if (ESP_LOG_ENABLED(level)) { \
47 esp_log_buffer_char_internal(tag, buffer, buff_len, level); } } while(0)
48
49#define ESP_LOG_BUFFER_HEXDUMP(tag, buffer, buff_len, level) \
50 do { if (ESP_LOG_ENABLED(level)) { \
51 esp_log_buffer_hexdump_internal(tag, buffer, buff_len, level); } } while(0)
52
53#define ESP_LOG_BUFFER_HEX(tag, buffer, buff_len) \
54 do { if (ESP_LOG_ENABLED(ESP_LOG_INFO)) { \
55 ESP_LOG_BUFFER_HEX_LEVEL(tag, buffer, buff_len, ESP_LOG_INFO); } } while(0)
56
57#define ESP_LOG_BUFFER_CHAR(tag, buffer, buff_len) \
58 do { if (ESP_LOG_ENABLED(ESP_LOG_INFO)) { \
59 ESP_LOG_BUFFER_CHAR_LEVEL(tag, buffer, buff_len, ESP_LOG_INFO); } } while(0)
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif // __VSF_ESPIDF_ESP_LOG_BUFFER_H__
esp_log_level_t
Definition esp_log.h:43
void esp_log_buffer_hex_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t level)
Definition esp_log_buffer_port.c:30
void esp_log_buffer_char_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t level)
Definition esp_log_buffer_port.c:44
void esp_log_buffer_hexdump_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t log_level)
Definition esp_log_buffer_port.c:54
unsigned short uint16_t
Definition stdint.h:7
Generated from commit: vsfteam/vsf@c3767bf