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

feat(core): add ability to take geth stderr #2010

Merged
merged 1 commit into from Jan 4, 2023

Conversation

Rjected
Copy link
Contributor

@Rjected Rjected commented Jan 4, 2023

Motivation

The GethInstance logs are useful for understanding what geth is doing, and there is currently no way to extract the pid.stderr so the logs can be read.

Solution

Implement a stderr method on GethInstance that uses take() to return a ChildStderr, which can then be read with a BufReader or other methods.

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog
  • Breaking changes

 * makes the geth logs accessible by using take() on the GethInstance
   stderr
Comment on lines +83 to +84
pub fn stderr(&mut self) -> Result<ChildStderr, GethInstanceError> {
self.pid.stderr.take().ok_or(GethInstanceError::NoStderr)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could also do an Option but since we already have NoStdErr, let's use this result

@gakonst gakonst merged commit 9147ee8 into gakonst:master Jan 4, 2023
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.

None yet

3 participants