[SYS] Reduce Logs flash footprint (#2232)

By building only the log level required into LOG_LEVEL

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2025-08-19 09:15:41 -05:00
1 parent 6e6b54b05e
commit 32174e37a5
52 files changed
+1187 -1136

No files matched your search

+36
View File
@@ -599,11 +599,47 @@ extern ss_cnt_parameters cnt_parameters_array[];
# define subjectMQTTtoSYSupdate "/commands/MQTTtoSYS/firmware_update"
#endif
#define TimeToResetAtStart 5000 // Time we allow the user at start for the reset command by button press
#include <ArduinoLog.h>
/*-------------------DEFINE LOG LEVEL----------------------*/
#ifndef LOG_LEVEL
# define LOG_LEVEL LOG_LEVEL_NOTICE
#endif
/*-------------------SIMPLIFIED LOGGING MACROS----------------------*/
// ArduinoLog levels: SILENT=0, FATAL=1, ERROR=2, WARNING=3, NOTICE=4, TRACE=5, VERBOSE=6
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
# define THEENGS_LOG_VERBOSE(...) Log.verbose(__VA_ARGS__)
#else
# define THEENGS_LOG_VERBOSE(...) ((void)0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_TRACE
# define THEENGS_LOG_TRACE(...) Log.trace(__VA_ARGS__)
#else
# define THEENGS_LOG_TRACE(...) ((void)0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_NOTICE
# define THEENGS_LOG_NOTICE(...) Log.notice(__VA_ARGS__)
#else
# define THEENGS_LOG_NOTICE(...) ((void)0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_WARNING
# define THEENGS_LOG_WARNING(...) Log.warning(__VA_ARGS__)
#else
# define THEENGS_LOG_WARNING(...) ((void)0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_ERROR
# define THEENGS_LOG_ERROR(...) Log.error(__VA_ARGS__)
#else
# define THEENGS_LOG_ERROR(...) ((void)0)
#endif
#if LOG_LEVEL >= LOG_LEVEL_FATAL
# define LOG_FATAL(...) Log.fatal(__VA_ARGS__)
#else
# define LOG_FATAL(...) ((void)0)
#endif
/*-------------------ESP Wifi band and tx power ---------------------*/
//Certain sensors are sensitive to Wifi which can cause interference with their normal operation
//For example it can cause false triggers on a PIR HC-SR501