-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Customer Logger Redirect Issue (ESPTOOL-1016) #1066
Comments
Hi @JeremiahGillis! Please be aware that (1) the following suggestions are generated by a bot and haven't been fact-checked by Espressif Systems, (2) burning eFuses and enabling security features are irreversible operations and can damage your ESP32 device. We hope that this message will help you until an Espressif Engineer looks at your issue. Thank you for bringing this issue to our attention. I apologize for the inconvenience caused by the example in our documentation. You're correct that there's an issue with the custom logger example provided. Let me address this based on the information from our knowledge sources. The example you're referring to is indeed present in our documentation for multiple ESP32 variants. The correct implementation of the def error(self, message):
self.print(message, file=sys.stderr) This correction is consistent across all our documentation for different ESP32 variants, including ESP32, ESP32-C3, and others. The issue arises because the original example didn't import the import sys
from esptool.logger import log, TemplateLogger
class CustomLogger(TemplateLogger):
# ... other methods ...
def error(self, message):
self.print(message, file=sys.stderr)
# ... rest of the class ... Thank you for identifying this oversight. We'll update our documentation to include the If you encounter any further issues or have additional questions, please don't hesitate to ask. We appreciate your contribution to improving our documentation and tools. |
Hi @JeremiahGillis, thanks for the report and for trying out the new logger! The feedback is appreciated. We will fix the documentation example ASAP. |
@radimkarnis The new commit causes an issue elsewhere:
Some print_overwrite functions pass Lines 637 to 639 in eaaa6b3
Lines 707 to 711 in eaaa6b3
This is why my suggest fix has to have |
🤦 sorry for that, you are right. ok, let's do another round |
* docs: fix minor issues and improve vague statements * feat(esp32h21): Add Microsoft UF2 family ID * fix(logging): Avoid crashes when flushing if sys.stdout is not available Closes espressif#1064 Closes espressif#1063 * change(github): Add Github workflow for bot responses to issues * fix(elf2image): Print correct MMU page size in error message * fix(elf2image): Try to correct MMU page size if not specified This commit fixes issue with using elf2image command without --flash-mmu-page-size. In that case, app info segment might be incorrectly placed in the image. This is fixed by checking if app info segment is present and if so, use page size from it or from its alignment. Closes espressif#1062 * fix(elf2image): support --flash-mmu-page-config for all chips This commit fixes the issue where the `--flash-mmu-page-config` option did not work for chips that do not have configurable MMU page sizes. * fix(esptool): Fix efuse base address for esp32h21 * remove: Deprecate Python versions 3.7, 3.8 and 3.9 BREAKING CHANGE * docs(logger): Fix custom logger example code Closes espressif#1066 * feat(esp32h4): add ESP32H4 esptool support * feat(espefuse): Updates esp32h4 efuse table and fixes tests - Added esp32h4 efuse table - Fixed h4 test - Enabled some tests for p4 chip. * feat(esp32h4): update the ESP32H4StubLoader * change: fix issues reported by ruff linter * ci: update pre-commit hooks to the latest versions * feat(flash_attach): Encapsulate logic for flash attaching and configuration * refactor(cli_mode): Improve CLI mode workflow code * feat(cmds): Rework the public API to work as a Python module BREAKING CHANGE Closes espressif#208 * feat(cmds): Allow commands to output bytes, as well as write to a file * fix(lint): Correct type annotations issues reported by mypy * Tasmota changes * update manifest * Update build_esptool.yml * Update build_esptool.yml * docs(logger): Fix custom logger example code Closes espressif#1066 --------- Co-authored-by: Peter Dragun <[email protected]> Co-authored-by: Radim Karniš <[email protected]> Co-authored-by: Roland Dobai <[email protected]> Co-authored-by: Jaroslav Burian <[email protected]> Co-authored-by: Konstantin Kondrashov <[email protected]> Co-authored-by: Chen Jichang <[email protected]>
Thanks for adding the custom logger. I tested this today and found an issue using your example function:
esptool/docs/en/esptool/scripting.rst
Lines 102 to 104 in 6d04155
This will result in an error:
The example function should be:
This fixes my error and allows the device to be fully programmed.
The text was updated successfully, but these errors were encountered: