Change Serial logging to flexible logging (#690)

* Add Logging class
Add Logging class which inherits from Print class, to be able to route logging to USB Serial or to memory for display in the webpage. Adds a log webpage only visible when DEBUG_VIA_WEB is defined.
This commit is contained in:
mvgalen 2024-12-22 22:48:35 +01:00 committed by GitHub
parent b2aa3dc75b
commit c713d0a94e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 1020 additions and 798 deletions

View file

@ -66,6 +66,11 @@
/* Other options */
//#define DEBUG_VIA_USB //Enable this line to have the USB port output serial diagnostic data while program runs (WARNING, raises CPU load, do not use for production)
//#define DEBUG_VIA_WEB //Enable this line to log diagnostic data while program runs, which can be viewed via webpage (WARNING, slightly raises CPU load, do not use for production)
#if defined(DEBUG_VIA_USB) || defined(DEBUG_VIA_WEB)
#define DEBUG_LOG
#endif
//#define DEBUG_CAN_DATA //Enable this line to print incoming/outgoing CAN & CAN-FD messages to USB serial (WARNING, raises CPU load, do not use for production)
//#define INTERLOCK_REQUIRED //Nissan LEAF specific setting, if enabled requires both high voltage conenctors to be seated before starting
//#define CAN_ADDON //Enable this line to activate an isolated secondary CAN Bus using add-on MCP2515 chip (Needed for some inverters / double battery)