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

Log user input in the main loop #64

Merged
merged 1 commit into from
Dec 1, 2022
Merged

Log user input in the main loop #64

merged 1 commit into from
Dec 1, 2022

Conversation

riley-harper
Copy link
Contributor

Closes #57.

This is a small PR that updates the main loop to log user commands when they are input. This makes use of the precmd hook, which is called after input is received and before it is parsed and commands executed. To avoid flooding the logs with unhelpful information, I filtered out lines that are only whitespace so that they are not logged.

After considering a few different formats for logging user input, I settled on a format like [User Input] run_all_steps preprocessing matching, which I find fairly easy to read and also easily distinguishable from other log lines.

This provides additional context for errors and other logging information. It
filters out input that's just whitespace to avoid flooding the logs.
Copy link
Collaborator

@jacwellington jacwellington left a comment

Choose a reason for hiding this comment

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

Looks great!

@riley-harper riley-harper merged commit 46fede6 into main Dec 1, 2022
@riley-harper riley-harper deleted the log_user_input branch December 1, 2022 22:41
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.

Log user commands
2 participants