Skip to content

Commit

Permalink
Merge pull request #116 from chrislewis60/output_handling_documentation
Browse files Browse the repository at this point in the history
Updated documentation for output handling
  • Loading branch information
leehambley committed Feb 26, 2014
2 parents 723d0a0 + 41dd588 commit 32949cf
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions README.md
Expand Up @@ -201,22 +201,21 @@ first argument before attempting to find it in the *command map*.

![Example Output](https://raw.github.com/leehambley/sshkit/master/assets/images/example_output.png)

The output handling comprises two objects, first is the output itself, by
default this is *$stdout*, but can be any object responding to a
*StringIO*-like interface. The second part is the *formatter*.

The *formatter* and *output* have a strange relationship:
By default, the output format is set to `:pretty`:

```ruby
SSHKit.config.output = SSHKit.config.formatter.new($stdout)
SSHKit.config.format = :pretty
```

The *formatter* will typically delegate all calls to the *output*, depending
on it's implementation it will almost certainly override the implementation of
`write()` (alias `<<()`) and query the objects it receives to determine what
should be printed.
However, if you prefer minimal output, `:dot` format will simply output red or green dots based on the success or failure of operations.

To output directly to $stdout without any formatting, you can use:

```ruby
SSHKit.config.output = $stdout
```

## Verbosity
## Output Verbosity

By default calls to `capture()` and `test()` are not logged, they are used
*so* frequently by backend tasks to check environmental settings that it
Expand Down

0 comments on commit 32949cf

Please sign in to comment.