AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_print.h
Go to the documentation of this file.
1
6#ifndef _LIB_PRINT_H_
7#define _LIB_PRINT_H_
8
9#include "esp_system.h"
10#include "esp_types.h"
11#include "lib_config.h"
12#include "stdutils.h"
13
14/***************************************************************************************************
15 Function Prototypes
16 ***************************************************************************************************/
17
25
32void print_setDefaultLogLevel(uint8_t maxModules_u8, logLevels_et *pLogLevels_e);
33
41void print_serial(menusLibModule_et module_e, logLevels_et logLevel_e, const char *pFunNameStr, const char *pArgListStr, ...);
42
51
58
65
66#define print_verbose(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_VERBOSE, __func__, var_arg_list)
67#define print_error(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_ERROR, __func__, var_arg_list)
68#define print_info(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_INFO, __func__, var_arg_list)
69#define print_debug(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_DEBUG, __func__, var_arg_list)
70
71#define print_verbose_raw(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_VERBOSE, NULL, var_arg_list)
72#define print_error_raw(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_ERROR, NULL, var_arg_list)
73#define print_info_raw(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_INFO, NULL, var_arg_list)
74#define print_debug_raw(var_arg_list...) print_serial(thisModule, PRINT_LEVEL_DEBUG, NULL, var_arg_list)
75
76#define PRINTF printf
77
78/**************************************************************************************************/
79
80#endif /* LIB_PRINT_H_ */
Configuration header file.
logLevels_et
Levels of debug messages for printing.
Definition: lib_config.h:33
menusLibModule_et
An enum to represent Library modules.
Definition: lib_config.h:54
void print_enableLogs()
Enable logs.
void print_setLogLevel(menusLibModule_et module_e, logLevels_et logLevel_e)
Set the log level of a given library file.
void print_disableLogs()
Disable logs.
void print_serial(menusLibModule_et module_e, logLevels_et logLevel_e, const char *pFunNameStr, const char *pArgListStr,...)
Print the log message on serial terminal.
bool print_isLogsEnabled()
Check if logs are enabled.
void print_setDefaultLogLevel(uint8_t maxModules_u8, logLevels_et *pLogLevels_e)
Set the given log levels as default.