Clarify invalid log level message [GH-645]

This commit is contained in:
Mitchell Hashimoto 2012-01-18 09:40:01 -08:00
parent 04126eb20d
commit 3ab8aaa1b0
2 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,8 @@
## 0.9.1 (unreleased)
- Clearer invalid log level error. [GH-645]
- Fix exception raised with NFS `recover` method.
- Fix `ui` `NoMethodError` exception in puppet server.
## 0.9.0 (January 17, 2012)

View File

@ -14,7 +14,21 @@ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != ""
# This means that the logging constant wasn't found,
# which is fine. We just keep `level` as `nil`. But
# we tell the user.
level = nil
end
# Some constants, such as "true" resolve to booleans, so the
# above error checking doesn't catch it. This will check to make
# sure that the log level is an integer, as Log4r requires.
level = nil if !level.is_a?(Integer)
if !level
# We directly write to stderr here because the VagrantError system
# is not setup yet.
$stderr.puts "Invalid VAGRANT_LOG level is set: #{ENV["VAGRANT_LOG"]}"
$stderr.puts ""
$stderr.puts "Please use one of the standard log levels: debug, info, warn, or error"
exit 1
end
# Set the logging level on all "vagrant" namespaced