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 log to file option #6

Merged
merged 8 commits into from
Jun 5, 2021
Merged

Add log to file option #6

merged 8 commits into from
Jun 5, 2021

Conversation

aaronvb
Copy link
Owner

@aaronvb aaronvb commented Jun 5, 2021

This adds a --log <filename> flag to rh which will write the CLI output to the specified log file.

Also includes some additional refactoring:

  • Removed ErrorLogger which was only being used by the CLI to return http.Server errors.
  • Created a new renderer interface function which handles incoming request headers. Previously this was handled in incoming requests method which was harder to test for any structs that implement it.

- Added request.http whic his for vscode rest client extension
- Added log files
- Added binary
Instead of doing the details check in the printer we now handle
that in the http server and call an interface function on renderer.
It didn't make sense to have the ErrorLogger part of the renderer
interface if it was ONLY used for http.Server error handling.

We don't plan to render that information to any other renderer,
such as logging.

Insted we'll just print the errors to the CLI output using pterm.
Accepts a CLI flag `--log <filename>` which will write the CLI
output to a log file.
Trying to test the actual terminal output doesn't always work
across different platforms.
@aaronvb aaronvb merged commit 251ebe2 into main Jun 5, 2021
@aaronvb aaronvb deleted the add-log-output branch June 5, 2021 02:58
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.

1 participant