Skip to content

Update handlers.py to have a configurable message_separator_character #24556

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

Closed
wants to merge 2 commits into from

Conversation

reahaas
Copy link

@reahaas reahaas commented Feb 17, 2021

SyslogHandler, emit function add the nul_character to the message. This PR allows the user to choose what character to use to separate messages.
The functionality of append_nul that was a boolean variable stays the same since the user can override this value since it's a class attribute:
From the docs:

To enable easier handling of Syslog messages in the face of all these differing daemon behaviours, the appending of the NUL byte has been made configurable, through the use of a class-level attribute, append_nul. This defaults to True (preserving the existing behaviour) but can be set to False on a SysLogHandler instance in order for that instance to not append the NUL terminator.

So now this functionality is possible through setting:

message_separator_character = ''  # using the empty string
# instead of doing:
# append_nul = False

SyslogHandler, emit function add the nul_character to the message. This PR allows the user to choose what character to use to separate messages.
The functionality of `append_nul` that was a boolean variable stays the same since the user can override this value since it's a class attribute:
From the docs:
```
To enable easier handling of Syslog messages in the face of all these differing daemon behaviours, the appending of the NUL byte has been made configurable, through the use of a class-level attribute, append_nul. This defaults to True (preserving the existing behaviour) but can be set to False on a SysLogHandler instance in order for that instance to not append the NUL terminator.
```
So now this functionality is possible through setting:
```
message_separator_character = ''  # using the empty string
# instead of doing:
# append_nul = False
```
@reahaas reahaas requested a review from vsajip as a code owner February 17, 2021 15:26
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@reahaas

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Better concatenating of the message_separator_character to the msg.
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Mar 20, 2021
@iritkatriel
Copy link
Member

please create an issue on bpo and explain what problem you are trying to solve here.

Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

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

This PR needs an issue on bpo, unit tests and documentation change.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Feb 19, 2022
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity. If the CLA is not signed within 14 days, it will be closed. See also https://devguide.python.org/pullrequest/#licensing

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Mar 21, 2022
@github-actions
Copy link

github-actions bot commented Apr 4, 2022

Closing this stale PR because the CLA is still not signed.

@github-actions github-actions bot closed this Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants