-
Notifications
You must be signed in to change notification settings - Fork 5
ComToTcpServer.py Updates [Rebase & FF] #13
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
Conversation
cfernald
left a comment
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.
There is a known issue with the build only running on extension changes that prevents merges. Let me open a PR to fix that so your pipelines will run, at least until more build pipeline operations are added.
This should be resolved after updating the branch. |
Makes it easier to understand why the script failed. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
- Use f-strings consistently - Remove unused module imports - Make a print statement more concise/readable Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Currently a character that fails to decode as ascii will result in an exception and stop logging. This change ignores the failure and allows logging to continue. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Non-functional change to pass flake8 checks and improve code readability with type hints and doc comments. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Replace custom log file handling with Python loggers for improved
control, cleaner output, and cleaner code.
- Replace `--logfile` with `--log-path` supporting both files
and directories
- Giving a directory generates new timestamped log files on
each run
- Add separate `--script-log-file` for operational logging
- Separate loggers for script operations and serial data
- Add a `--show-direction` flag for optional IN/OUT directional
indicators in log output
- More clearly indicates data flow direction than the previous
prefixing method separators (`<<<` and `>>>`)
- Implement line buffering to prevent newlines in chunked data
- Strip carriage returns to eliminate blank lines in logs
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
eb322d9 to
feb68a3
Compare
Improvements for script maintainability and user experience. Also adds code documentation, type hints, and runs the code through flake8.
ComToTcpServer.py: Print errors when connecting to pipes or com ports
Makes it easier to understand why the script failed.
ComToTcpServer: Non-functional cleanup
ComToTcpServer: Prevent ascii decode errors writing to the log files
Currently a character that fails to decode as ascii will result
in an exception and stop logging. This change ignores the failure
and allows logging to continue.
ComToTcpServer: Fix all flake8 issues, add type hints, and doc comments
Non-functional change to pass flake8 checks and improve code
readability with type hints and doc comments.
ComToTcpServer: Refactor logging
Replace custom log file handling with Python loggers for improved
control, cleaner output, and cleaner code.
--logfilewith--log-pathsupporting both filesand directories
each run
--script-log-filefor operational logging--show-directionflag for optional IN/OUT directionalindicators in log output
prefixing method separators (
<<<and>>>)