Commit Graph

3 Commits

Author SHA1 Message Date
Anthony DiGirolamo
427edb2eb7 pw_console: Serial bytes logging
- Move pw_console python logging related functions to python_logging.py

- Add a PwConsoleEmbed.setup_python_logging to:
  - Silence debug messages from prompt_toolkit and asyncio.
  - Disable all Stdout and Stderr handlers.

- log_line.py and table.py:
  Strip trailing white space to prevent extra line breaks showing up in
  the log window.

- pw_console/py/pw_console/pyserial_wrapper.py
  - SerialWithLogging class that wrapps read and write to add logging
  - Logs with metadata columns (byte length and Read/Write) and hex
    numbers aligned with characters.

- pw_hdlc/py/pw_hdlc/rpc_console.py:
  - Add two additional log panes for serial debug and host log messages
    (hidden by default).
  - New --serial-debug to turn on SerialWithLogging

Bug: 403
Test: openocd -f targets/stm32f429i_disc1/py/stm32f429i_disc1_utils/openocd_stm32f4xx.cfg -c "program out/stm32f429i_disc1_debug/obj/pw_hdlc/rpc_example/bin/rpc_example.elf verify reset exit"
Test: pw rpc -d /dev/ttyACM0 -b 115200 --proto-globs pw_rpc/echo.proto
Change-Id: I579d93eb77dea0825c21d91ff2251080bac2186d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56784
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2021-10-06 21:33:35 +00:00
Anthony DiGirolamo
bf5682a9ac pw_console: Refactor embed free function
- Add the PwConsoleEmbed class for future customization of the embedded
  environment before actually running it.
- Set repl start and stop logs to debug level.

Testing: No UI code changes.
Change-Id: Ifd8407b6b51a046f1139ca535cb998ad0b82d3ca
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55860
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2021-08-03 04:14:51 +00:00
Anthony DiGirolamo
464409932a pw_console: Cleanup mouse_handler functions
Create pw_console.widgets.mouse_handlers.on_click to simplify
creating clickable text in toolbars.

Started the manual testing guide.

Change-Id: I01ebbc01926c4a224936fef4437730ab3e49c69d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53701
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-07-21 05:10:55 +00:00