-
Notifications
You must be signed in to change notification settings - Fork 911
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
Debug Update to Add a Password Scrubber and stdout style LogType #1648
Conversation
ah crap i commited my build binary.. fixing |
a8454ff
to
b1abd65
Compare
removed binary and force pushed, sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @luthermonson , +1 to both scrubbing the password and having a stderr option for -debug
. Just don't want to change the existing behavior, -debug
alone should still default to using ~/.govmomi/debug
0f708c7
to
c6816ae
Compare
@dougm updated per feedback and rebased to one commit and force pushed |
c6816ae
to
344653c
Compare
@dougm added readme update to deocument |
Thanks @luthermonson , esp. for adding the long overdue docs. Keep in mind that debug also works with json (tags, content library, etc). Personally I always have: % env | grep GOVC_DEBUG
GOVC_DEBUG_PATH_RUN=last
GOVC_DEBUG=true And the I run I think it'd be awesome to have |
Most important part of this PR is the Scrub method added to the debug output to remove your password from the logs. To do this I just wrote a wrapper CloseWrite for FileType and to debug easier I wrote a LogType so decided to include it in the PR.
LogType uses go's log package and fakes a write/close to pass to the TeeReader and instead run a
log.Print()
on the contents which are normally written to file. This will show debug in your console while the command is running. @dougm would love your feedback as output is a bit messy but I didn't want to rock the boat too hard and kept some of file output like filename etc.I additionally added a -debug to default to the stdout LogType method if no GOVC_DEBUG_PATH is not set so you don't magically write some log files without the govc user knowing (which happened to me)