-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Implement comprehensive error logging system with user-accessible error log and custom message support #4961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
c03ced5
07f408e
cc827c8
61b11e1
756697a
4b6df49
7ce7c93
7d79c52
7f6778a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -889,6 +889,20 @@ WLED_GLOBAL byte currentPreset _INIT(0); | |
|
||
WLED_GLOBAL byte errorFlag _INIT(0); | ||
|
||
// Error logging system | ||
struct ErrorLogEntry { | ||
|
||
unsigned long timestamp; // millis() when error occurred | ||
byte errorCode; // error number (8bit) | ||
byte tag1; // future use tag 1 | ||
byte tag2; // future use tag 2 | ||
byte tag3; // future use tag 3 | ||
}; | ||
|
||
#define ERROR_LOG_SIZE 5 | ||
WLED_GLOBAL ErrorLogEntry errorLog[ERROR_LOG_SIZE]; | ||
WLED_GLOBAL byte errorLogIndex _INIT(0); | ||
WLED_GLOBAL byte errorLogCount _INIT(0); | ||
|
||
WLED_GLOBAL String messageHead, messageSub; | ||
WLED_GLOBAL byte optionType; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to do this using the websocket connection or is this the better way? in any case, use a short string "clrErrLog"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to shorter string "clrErrLog" in commit 4b6df49. The fetch API approach is suitable here as it allows the client to send the command and handle the response properly, ensuring the local state is synchronized with the server clearing operation.