[LOG] Adding a filter for the weblog#5484
Conversation
|
Should i also change the functions in |
That FR: Can this search (also) handle wildcards or regular expressions? |
No, I wanted it to be as simple and small as possible, but this can surely be added.
This is basically included since it filters also phrases. At least in my understanding. |
|
I might want to add an option to show an x number of lines after a matching line. But not sure how to flag this as an option in the filter field (also not sure if it is really necessary. I am actually quite happy with how it works now). |
|
You could also add a CTRL-F like option to move to the lines and then add an attribute to those lines to highlight the parts where it occurs. |
The intent is to have the console log nicely aligned, but 5 characters is not enough to hold |
|
Ok.. for now we have: I chose this over standard regex so that mere mortal people can use it too. :) |
|
The idea of the So that's also one reason why I was thinking about splitting this into something else. The idea was to allow for filtering, but now you already have that part 'solved'... ;) |
|
Ah, now we're going somewhere 😆 Just waiting for the code changes 😉 |
Comes tomorrow. Right now, I have to find a movie. Which takes all my resources :) |
If you can't find it, you can watch a YouTube short... and then continue ;) |
- Added highlight filter phrases - Added ordered AND operator (&) - Added exclusion (!)
|
Ok, I just committed all the changes. It would be nice if somebody could test it. Also: I am not sure if highlighting is really necessary. If you like it, we keep it. |
|
Well it is hard to add 'context'. N.B. did you notice you now also get the web log from boot when you access it within 30 sec after boot? (on ESP32, ESP8266 does have a shorter TTL for log entries) |
- Added a check to determine if there is already a filter field present; otherwise, add one for older builds.
|
I added a bit of code so that every build can make use of the filter. The script checks first if there is a filter field and if not injects it via the script. |
|
Can you also make a commit which removes that one file which is not part of this PR? |
BTW: This is really cool and helpful! :) |
- Fixes a long-existing autoscroll issue where the whole site would scroll instead of just the log content. - reducing the code by simplifying the „browser check" and refining the loop
…into filter-weblog
...while I am at it :)
|
FIY: I think I am done here.... :) |
|
Hmm this breaks the web log. Which is: |
|
Seems like this line got lost somehow when minimizing the JS? |
|
Yep, added that line and logs are working again.... |
Ohh…good. I was just starting a new PR with a fix. |
|
There is also something else with the minified code... Right now it seems to be ignored and I think I can add a flag to explicitly ignore this as we really don't want to use the |
Can be ignored since the compiler is misinterpreting the JS. |
|
You want me to make a new PR with both fixes? |
"nullish coalescing operator". |
|
@TD-er @chromoxdor little off topic, did you know not all log lines are received by weblog? |
Is this an issue that was introduced by this PR? |
With latest ESPEasy code? |
Yes please :) |
@TD-er latest normal 4M1M release from github, need something more to investigate? Just tried PID in rules implementation and surprised about not all variables printed out in weblog (info level). From log: |
|
Was it a burst of messages? The current implementation is a list of log messages. And of course the log line itself. A message will be removed from this list if either all the subscriber bits are cleared or the TTL has expired. For the weblog, as soon as a JSON message has been generated, the messages in that JSON are marked as read for the weblog subscriber. I have to check the code, but I don't think there is a max. number of messages anymore, only limited by memory usage. So on ESP32 (with TTL of 30 sec per message), if you connect to the weblog within 30 sec from boot, you will get all messages. In my tests, I managed to fetch >100 kB of JSON which was working fine. N.B. flash string log entries will take only the pointer to the flash string (+ the header stuff like timestamp, log level, subscriber count, etc.) N.B.2 Console output is "LogLevelNone", so it is using the same queue system. |
|
By the way, which "latest release" do you mean? |
|
@TD-er https://github.com/letscontrolit/ESPEasy/releases/tag/mega-20260125 but this problem is also on 2024 builds. |
|
Yep that's not yet using the newer system I made. |
|
@TD-er looks like about lets say 10 lines is lost and then you get 20 lines later after that same lines are not shown and 20 lines are ok. |
|
The old log system was using separate buffers. |
|
What am I suppoust to test? |
|
Well unless you are willing to switch to the newer builds, there is not yet much to test. |
|
I just uploaded the last merged build with this log filter to here: https://td-er.nl/ESPEasy/latest/ |



Made a filter. It was easier than I thought :)
Should I make the changes optional/custom?
;.!.&.