mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Configurable HASP_LOG_LEVEL
This commit is contained in:
parent
3311de016c
commit
ee568a791a
@ -4,10 +4,16 @@
|
|||||||
#ifndef HASP_MACRO_H
|
#ifndef HASP_MACRO_H
|
||||||
#define HASP_MACRO_H
|
#define HASP_MACRO_H
|
||||||
|
|
||||||
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
|
#include "user_config_override.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WINDOWS) || defined(POSIX)
|
#if defined(WINDOWS) || defined(POSIX)
|
||||||
#define LOG_OUTPUT(x, ...) printf(__VA_ARGS__)
|
#define LOG_OUTPUT(x, ...) printf(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include "ArduinoLog.h"
|
||||||
|
|
||||||
#ifndef HASP_LOG_LEVEL
|
#ifndef HASP_LOG_LEVEL
|
||||||
#define HASP_LOG_LEVEL LOG_LEVEL_TRACE
|
#define HASP_LOG_LEVEL LOG_LEVEL_TRACE
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,7 +73,7 @@ void task_every_second_cb(lv_task_t* task)
|
|||||||
case 5:
|
case 5:
|
||||||
#ifdef HASP_USE_STAT_COUNTER
|
#ifdef HASP_USE_STAT_COUNTER
|
||||||
if(statLoopCounter)
|
if(statLoopCounter)
|
||||||
LOG_VERBOSE(TAG_MAIN, F("%d millis per loop, %d counted"), 5000 / statLoopCounter, statLoopCounter);
|
LOG_DEBUG(TAG_MAIN, F("%d millis per loop, %d counted"), 5000 / statLoopCounter, statLoopCounter);
|
||||||
statLoopCounter = 0;
|
statLoopCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -114,7 +114,7 @@ void debugStartSyslog()
|
|||||||
|
|
||||||
if(syslogClient) {
|
if(syslogClient) {
|
||||||
if(syslogClient->beginPacket(debugSyslogHost, debugSyslogPort)) {
|
if(syslogClient->beginPacket(debugSyslogHost, debugSyslogPort)) {
|
||||||
Log.registerOutput(2, syslogClient, LOG_LEVEL_VERBOSE, true);
|
Log.registerOutput(2, syslogClient, HASP_LOG_LEVEL, true);
|
||||||
LOG_INFO(TAG_SYSL, F(D_SERVICE_STARTED));
|
LOG_INFO(TAG_SYSL, F(D_SERVICE_STARTED));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -364,7 +364,7 @@ void debugStartSerial()
|
|||||||
|
|
||||||
Serial.begin(baudrate); /* prepare for possible serial debug */
|
Serial.begin(baudrate); /* prepare for possible serial debug */
|
||||||
delay(10);
|
delay(10);
|
||||||
Log.registerOutput(0, &Serial, LOG_LEVEL_VERBOSE, true); // LOG_LEVEL_VERBOSE
|
Log.registerOutput(0, &Serial, HASP_LOG_LEVEL, true); // LOG_LEVEL_VERBOSE
|
||||||
|
|
||||||
// debugSerialStarted = true;
|
// debugSerialStarted = true;
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ IRAM_ATTR void loop()
|
|||||||
mainLoopCounter = 0;
|
mainLoopCounter = 0;
|
||||||
#ifdef HASP_USE_STAT_COUNTER
|
#ifdef HASP_USE_STAT_COUNTER
|
||||||
if(statLoopCounter)
|
if(statLoopCounter)
|
||||||
LOG_VERBOSE(TAG_MAIN, F("%d millis per loop, %d counted"), 5000 / statLoopCounter, statLoopCounter);
|
LOG_DEBUG(TAG_MAIN, F("%d millis per loop, %d counted"), 5000 / statLoopCounter, statLoopCounter);
|
||||||
statLoopCounter = 0;
|
statLoopCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -111,7 +111,7 @@ void consoleStart()
|
|||||||
debugStartSerial(); // open Serial port
|
debugStartSerial(); // open Serial port
|
||||||
|
|
||||||
/* Now register logger for serial */
|
/* Now register logger for serial */
|
||||||
Log.registerOutput(0, bufferedSerialClient, LOG_LEVEL_VERBOSE, true);
|
Log.registerOutput(0, bufferedSerialClient, HASP_LOG_LEVEL, true);
|
||||||
bufferedSerialClient->flush();
|
bufferedSerialClient->flush();
|
||||||
|
|
||||||
LOG_INFO(TAG_CONS, F(D_SERVICE_STARTED));
|
LOG_INFO(TAG_CONS, F(D_SERVICE_STARTED));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user