I've just started exploring drush, so please excuse me if something like this is already available. If it is, I'd like to know the command.

To make debugging easier, it would be nice to have the option to dump the debug info to a file. I understand one can increase the buffer size for a command window (I'm using Git from git-scm on Windows 7), click the Git icon in the upper left and use copy/paste, but I thought an option to dump debug information directly to a file would be handy. Something like:

$ drush make drupal.make htdocs/ --debug --debug-file="/some/path/to/file"

In my case, I was running a make file with debug enabled, it would run through the whole process but not create the site. After copying and pasting into a file and searching for errors, I found one module failing to download. Once I fixed it, everything worked fine. Not sure why drush doesn't fail with a warning, but that is neither here nor there. Just thought it would be nice to have the debug info write directly to file if the option is included.

If I new more about the internal workings of drush, I would write a patch myself.

Comments

greg.1.anderson’s picture

Category: feature » support
Status: Active » Fixed

You can do this with bash. Step one is to redirect stderr to stdout via 2>&1. After that, you can pipe the output to the "tee" command to both show the output in the terminal window and also save it to a file.

The end result is:

$ drush make drupal.make htdocs/ --debug 2>&1 | tee /some/path/to/file

This even works for interactive commands.

rbruhn’s picture

Thanks Greg. Had no idea since all this is relatively new :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.