orchardup/fig — pull request #370 by dnephin (2014-07-30 06:56:40+00:00)
Title: Add a --debug flag for debugging docker calls

Resolves #369 by adding logging around every call to the docker-py client.

Wrap the docker client in a `VerboseProxy` class which logs all calls and return values.
Example output of a `fig up`: http://pastebin.com/39FcctdV

Note: the `--verbose` flag is currently unused, but I felt this output was better categorized as debug, so I did not use it.

This involved a slight refactor to `fig.cli.command.Command`. It was necessary to expose options to the `get_client()` method. `cached_porperty` is no longer used, but each method is only called once.

I feel this refactor also had some nice side-effects:
* removed state from the command.Command class
* moved all yaml_path logic to `get_config_path()`, previously there was some in the constructor, and `perform_command()`
* moved all project_name logic to `get_project_name()`, previously there was some in `perform_command()`

I was also considering adding a couple lines at the start to print the fig version, and docker api version, which might also be useful for debug output.