Skip to content
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

Dynamic deletion of log messages #18

Open
Friedjof opened this issue Oct 14, 2023 · 0 comments
Open

Dynamic deletion of log messages #18

Friedjof opened this issue Oct 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Friedjof
Copy link
Owner

Friedjof commented Oct 14, 2023

The approaches to this can already be found in the LoggingManager under delete_first_n_lines.
The procedure is as follows:

  1. a temporary file is created in "w" mode.
  2. the system.log is scanned up to the new first line.
  3. transfer to the new file is started.
  4. the system.log is deleted and the temporary file is renamed.

An error occurs here during the last step. It seems that system.log is still open. However, I am very sure that this is not the case.
I have already tried to do the whole thing without a temporary file using a string buffer. However, that did not work either. I don't know exactly but I can't seem to write anything to the file. It would be good to start at that point.

For debugging, you can proceed as follows:

  1. make start upload fs and flash code
  2. connect to the wifi
  3. via https://192.168.4.1/logging you can read the content of the system.log.
  4. you can find more information about the length of the file and a bit more at https://192.168.4.1/log_lines.

This last endpoint can be removed after the fix.

@Friedjof Friedjof added the enhancement New feature or request label Oct 14, 2023
@Friedjof Friedjof assigned Friedjof and unassigned Friedjof Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant