scala-ssh
scala-ssh copied to clipboard
Safe logging
This PR changes how commands are logged and its completely opt-in, defaulting to the normal behaviour promiscuous logging. It also adds the actual exception message to the log for easier debugging. I'm completely open to suggestions.
Thank you, @jeffdyke, for this proposal. I have the feeling, however, that this is not yet the best approach to solve the problem of "having a way to prevent sensitive data from being logged".
How about giving commands the ability to control their own logging?
The default could be a simple .toString (what we currently have) and sensitive commands could construct their own logging output in any way they seem fit, which would usually be a "redacted" .toString or sth like that?
@sirthias thanks for your input. I'll give this some more time on your comments and clean it up. Looking at your comments i did make it a bit more verbose than i needed, so your view is appreciated.
While the comments are meaningfull, they are worthless...you'd likely rather re-review the full diff, i made it much simpler, looking forward to your thoughts, no breaking changes still. Thanks @sirthias!