From 28740943bbe2cd74c0db859f072dc91680ca61ba Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Thu, 31 Oct 2013 22:12:34 -0300 Subject: [PATCH] Add `--debug` option as a shortcut for `VAGRANT_LOG=debug` When asking or submitting debug information, a command line switch is easier and faster than using an environment variable. --- bin/vagrant | 7 +++++++ website/docs/source/v2/debugging.html.md | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/bin/vagrant b/bin/vagrant index fa51feb6a..de1e8b697 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -5,6 +5,13 @@ # initializing which have historically resulted in stack traces. Signal.trap("INT") { exit 1 } +# Set logging level to `debug`. This is done before loading 'vagrant', as it +# sets up the logging system. +if ARGV.include?("--debug") + ARGV.delete("--debug") + ENV["VAGRANT_LOG"] = "debug" +end + require 'log4r' require 'vagrant' require 'vagrant/cli' diff --git a/website/docs/source/v2/debugging.html.md b/website/docs/source/v2/debugging.html.md index 0821c815d..5fdc81774 100644 --- a/website/docs/source/v2/debugging.html.md +++ b/website/docs/source/v2/debugging.html.md @@ -37,6 +37,14 @@ $ vagrant up ... ``` +You can also get the debug level output using the `--debug` command line +option. For example: + +``` +$ vagrant up --debug +... +``` + If you plan on submitting a bug report, please submit debug-level logs along with the report using [gist](https://gist.github.com/) or some other paste service.