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

Add support for multiline logs and exceptions #60

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

furbrain
Copy link
Contributor

SPDX-FileCopyrightText: 2021 Adafruit Industries

SPDX-License-Identifier: MIT

This PR adds the exception method to the logging module. This can be
of use for detecting and recording unexpected bugs in log running
processes.

As the exception report includes newlines, I've made newline handling
more robust in StreamHandler.format - it splits all input lines into a
list (which is robust to different newline formats), and then uses
terminator to separate the lines - so changing the separator now
just means changing the value of terminator. FileHandler.format is now
redundant, as we just need to specify the terminator as "\r\n"

I have tested both StreamHandler and FileHandler on a Pico W and they work
as expected

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I tested it successfully on a Feather nrf52840

Thanks for the new functionality @furbrain!

@FoamyGuy FoamyGuy merged commit cbfea81 into adafruit:main Jun 23, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants