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

Syslog added to documentation #70

Merged
merged 7 commits into from
Oct 31, 2023
Merged

Syslog added to documentation #70

merged 7 commits into from
Oct 31, 2023

Conversation

KellerLiptrap
Copy link
Collaborator

@KellerLiptrap KellerLiptrap commented Sep 22, 2023

Addition of Chasten Log command documentation to the read me.

@KellerLiptrap KellerLiptrap added the documentation Improvements or additions to documentation label Sep 22, 2023
README.md Show resolved Hide resolved
@KellerLiptrap KellerLiptrap changed the title Syslog added to documentation WIP: Syslog added to documentation Sep 25, 2023
@gkapfham
Copy link
Collaborator

Hello @KellerLiptrap can you please write a description for this PR?

@simojo
Copy link
Collaborator

simojo commented Sep 26, 2023

When you run chasten log, chasten opens up a websocket server on 127.0.0.1:2525 (See chasten/server.py). This then implements a handler callback that prints messages to the console and logs them to the file .discover.log:

# server.py
class SyslogUDPHandler(socketserver.BaseRequestHandler):
    """Syslog UDP handler for receiving debugging messages."""

    def handle(self):
        """Receive a message and then display it in output and log it to a file."""
        global logger  # noqa: disable=PLW0603
        # receive the message from the syslog logging client
        message = bytes.decode(
            self.request[0].strip(), encoding=constants.server.Utf8_Encoding
        )
        # remove not-printable characters that can appear in message
        enhanced_message = str(message).replace(
            constants.markers.Bad_Fifteen, constants.markers.Empty_String
        )
        enhanced_message = enhanced_message.replace(
            constants.markers.Bad_Zero_Zero, constants.markers.Empty_String
        )
        # display the message inside of the syslog's console
        output.console.print(enhanced_message)
        # write the logging message to a file using a rotating file handler
        logger.debug(enhanced_message)

You can learn more about this by reading the source code.

I'm not completely sure about the whole intended functionality of this, but I would assume that, depending on the log level specified, the separate syslog process would pick up on this. Does anyone else have any more ideas as to how this works? I've only looked at it for a few minutes.

@KellerLiptrap KellerLiptrap changed the title WIP: Syslog added to documentation Syslog added to documentation Oct 11, 2023
@boulais01
Copy link
Collaborator

@KellerLiptrap Did you resolve the issue that Simon pointed out? If so, we can check that as resolved and add this to the list of PRs we can merge by Tuesday.

@KellerLiptrap
Copy link
Collaborator Author

@boulais01 Yes I have resolved these issues and updated this issue and added to the documentation. I believe that it can be added to the list to be merged.

@hayleepierce
Copy link
Collaborator

hayleepierce commented Oct 17, 2023

@KellerLiptrap If this PR is ready for review, make sure to add the label ready-for-review. Also, please ensure that you are working with the most up-to-date version of chasten.

@KellerLiptrap KellerLiptrap added the ready-for-review This pull request is ready for review label Oct 18, 2023
@KellerLiptrap KellerLiptrap self-assigned this Oct 18, 2023
@laurennevill
Copy link
Collaborator

@gkapfham, this is priority 4

README.md Outdated Show resolved Hide resolved
@laurennevill
Copy link
Collaborator

Hello @KellerLiptrap, can you ensure that this PR is up to date with the main branch? From there we can get this merged

MilesF25
MilesF25 previously approved these changes Oct 27, 2023
README.md Outdated Show resolved Hide resolved
@boulais01
Copy link
Collaborator

@laurennevill @jnormile I believe the issues you both brought up should be resolved now, if you wouldn't mind reviewing again.

@boulais01 boulais01 requested a review from MilesF25 October 30, 2023 13:44
Copy link
Collaborator

@tuduun tuduun left a comment

Choose a reason for hiding this comment

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

Good job on getting the requests done!

Copy link
Collaborator

@tuduun tuduun left a comment

Choose a reason for hiding this comment

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

Approved the Capitalization

@boulais01 boulais01 dismissed jnormile’s stale review October 31, 2023 17:32

Change completed

@boulais01
Copy link
Collaborator

@laurennevill this is ready to be merged when you deem it fit.

@laurennevill laurennevill merged commit af96c10 into master Oct 31, 2023
3 checks passed
@laurennevill laurennevill deleted the doc/syslog branch October 31, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ready-for-review This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants