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

Allows to change the error output direction #34

Closed
wants to merge 2 commits into from

Conversation

sungju
Copy link

@sungju sungju commented Jun 20, 2019

Currently, the error() is always printing the output to the console
through 'stdout'. This does not follow redirection which is good when
you want to know error while redirecting commands output to a file.
However, there are situations that you want to hide error messages or
redirect it into somewhere else.

Using 'set stderr' command, it can be changed to three different
destination - fixed 'stdout', following redirection (fp), or a custom
file path.

crash> set stderr
stderr: stdout
crash> sym 0x523 > /dev/null
sym: invalid address: 0x523
crash> set stderr fp
stderr: fp
crash> sym 0x523 > /dev/null
crash> set stderr /tmp/err.log
stderr: /tmp/err.log
crash> sym 0x523 > /dev/null
crash> set stderr stdout
stderr: stdout
crash> sym 0x523 > /dev/null
sym: invalid address: 0x523

sungju added 2 commits June 20, 2019 18:16
Currently, the error() is always printing the output to the console
through 'stdout'. This does not follow redirection which is good when
you want to know error while redirecting commands output to a file.
However, there are situations that you want to hide error messages or
redirect it into somewhere else.

Using 'set stderr' command, it can be changed to three different
destination - fixed 'stdout', following redirection (fp), or a custom
file path.

    crash> set stderr
    stderr: stdout
    crash> sym 0x523 > /dev/null
    sym: invalid address: 0x523
    crash> set stderr fp
    stderr: fp
    crash> sym 0x523 > /dev/null
    crash> set stderr /tmp/err.log
    stderr: /tmp/err.log
    crash> sym 0x523 > /dev/null
    crash> set stderr stdout
    stderr: stdout
    crash> sym 0x523 > /dev/null
    sym: invalid address: 0x523
When using file path for 'set stderr', we only accept the length
smaller than PATH_MAX (4096).
@crash-utility
Copy link
Collaborator

I don't accept github pull requests. Can you please post your patchset on the crash utility
mailing list:

https://www.redhat.com/mailman/listinfo/crash-utility

Thanks,
Dave

@sungju
Copy link
Author

sungju commented Jun 20, 2019

Sure Dave, I'll do. Thanks.

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.

2 participants