Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Reconnection Attempts and Logging for Wi-Fi Checker (Issue #347) #376
Add Reconnection Attempts and Logging for Wi-Fi Checker (Issue #347) #376
Changes from all commits
2718f80
584146f
cadf13c
9616be3
4ee8343
234028d
016e432
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
what is the need for this file? and this line specifically?
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.
The wifi_status_log.txt file is set up to capture logs from Wi-Fi connection events. Since it only starts filling when the code runs, it’s currently empty. Let me know if you’d prefer I remove it from the repository.
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.
Could you try to add the logic inside the script? This means that when the logging starts to capture, it should create the file automatically. That means there shouldn't be any file initially, but when the script runs and captures the log, it should create the file and then insert the data.
you can follow this code as reference:
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.
I absolutely can, I'll do that today.
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.
Everything is done.
Here are the updates I made to the script:
Automatic log file creation:
The script now checks if the log file exists. If not, it automatically creates the file before writing any logs.
Improved error handling:
Added better error handling for netsh and ping commands to ensure the script behaves more reliably in different scenarios.
Constants for better configuration:
Extracted key values like the log file name and ping target into constants for easier customization.
I tested everything, and it works as expected. Below is the log file when the WiFi is manually disabled:
This comment was marked as resolved.
Sorry, something went wrong.