X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=website%2Fbugs%2Fmonkeysphere-ssh-proxycommand-quiet-option.mdwn;h=124ddb8d7c46325fe37c800443385c2c145310e0;hb=b9f298ae159e54f47e1aaeb5c4150ca93a501e6e;hp=052b4edbbb5674bee674dc296ebba67883ea7637;hpb=050302344aba552900a199d76fab57fd49c05795;p=monkeysphere.git diff --git a/website/bugs/monkeysphere-ssh-proxycommand-quiet-option.mdwn b/website/bugs/monkeysphere-ssh-proxycommand-quiet-option.mdwn index 052b4ed..124ddb8 100644 --- a/website/bugs/monkeysphere-ssh-proxycommand-quiet-option.mdwn +++ b/website/bugs/monkeysphere-ssh-proxycommand-quiet-option.mdwn @@ -88,13 +88,11 @@ I'm open to suggestions, problems, etc :). ------ -Hey, your Royal Highness, push your branch where you did this work to -your public repo so that I can pull it and check out the changes you -made. I think it's good that I look over these changes, because there -is definitely some stuff (ie. key processing) that requires that -things go to standard error and definitely not to standard out. I can -see that if that were changed, it's possible that things could go -wrong (ie. cause a `known_hosts` file to get truncated maybe). +Hey, your Royal Highness. I do think it's good that I look over these +changes, because there are definitely some stuff (ie. key processing) +that requires that things go to stderr and definitely not to stdout. +I can see that if that were changed, it's possible that things could +go wrong (ie. cause a `known_hosts` file to get truncated maybe). I have to say that I'm still not sure I totally see why it's necessary to implement such nuanced output switches. All of the stuff you were @@ -128,3 +126,101 @@ In any event, I just want to outline a straightforward policy about output so we can know how to best handle it. -- Big Jimmy. + +----- + +I think it's important to be able to suppress "normal operation, +everything is fine" messages *without* directing stderr to +`/dev/null`. This is the normal state of UNIX-style tools, especially +tools like SSH which are used as piece of a larger toolchain. If +every tool in a toolchain emitted some output during successful +operation, many scripts would be hopeless seas of noise, as it's not +unusual for even a simple backup script to make use of a half-dozen +separate tools. + +What you really want is to see some output from when a tool knows +something is wrong. With the proxycommand, the job of complaining +will often be left up to `ssh` itself, after `~/.ssh/known_hosts` has +been appropriately modified. But sometimes, the proxycommand itself +will fail, and if you've already directed stderr to `/dev/null` you +won't get any reasonable information about the failure at the time it +happens. + +As for the interface to adjust the verbosity, HRH SJJ's current +proposal with a large number of environment variables seems confusing +and overly-complex to me. + +i think we should follow OpenSSH's lead (since all monkeysphere users +are likely to be somewhat familiar with it) and use a single variable +that is set to a level. For example, see `LogLevel` in +`ssh_config(5)`. It should probably default to `INFO`, same as +`/usr/bin/ssh`. If there was a way to extract this value from the +user's SSH configuration/invocation itself and adopt it in the +ProxyCommand, that would be even better, but i don't think that's a +possibility with OpenSSH 5.1p1 at this point. + +Also, i agree with HRH SJJ that the distinction in the monkeysphere +source between `log` and `loge` is unclear, and one of them should be +dropped (or they should be better-documented in `/src/common`). + + --dkg + +---- + +Thanks Big Jimmy and dkg all for the good feedback. + +I think you're right Big Jimmy about the sterr/stout. I may have +accidentally output to stout instead of sterr. In any event - I think +all of the logging should go to sterr to avoid that. + +Here's a proposed fix based on both of your responses - it tries to make +my changes a bit simpler and more consistent with ssh behavior: + + * Use on environmental variable: `MONKEYSPHERE_LOG_LEVEL` that can be set + to `ERROR` or `INFO`, with the default being `INFO`. + `monkeysphere-ssh-proxycommand`, however, will set the + `MONKEYSPHERE_LOG_LEVEL` to `ERROR` unless the user overrides that setting. + + * Use two functions for reporting messages to the user via sterr that + will replace the existing log/loge functions: info (for outputting + "normal operation, everything's fine" messages) and error (for + outputting messages that indicate a problem that we think a user should + know about). Reporting a message to the user with the info function + will only be sent if the `MONKEYSPHERE_LOG_LEVEL` setting is `INFO`. + Reporting a message to the user with the error function will always be + output regardless of the `MONKEYSPHERE_LOG_LEVEL` value. + + * Go through the code and, for each use of the current log/loge + function, determine if they should be replaced with info or error + depending on how critical we think the message is. + +How does that sound? + + --Sir Jam Jam + +----- + +Sir Jam Jam's proposal sounds good to me, but why make it two separate +functions? Given the number of log levels used by OpenSSH, i'd prefer +to make a single function that takes two arguments: the first argument +is the level of the log, and the second argument is the data to be +logged itself. So you'd say: + + log error "This is really terrible and broken!" + log info "The fuzzy bunny just smiled at you and nodded." + +Is that a reasonable amendment? It seems like it will make it easier +to add more levels if we find we need them, and it makes it easy to +find every single log message in the source code at the same time. + + --dkg + +----- + +I just implemented the proposal (incorporating dkg's suggestion about +only having one function). It's committed in my quiet-mode branch (still +not merged with master - pending review). + +Thanks for all the feedback! + +-- SJJ