Add an environment option to suppress info msgs

It's often you want counts of just WARN and ERROR messages, and don't
want to spam yourself with INFO messages that you don't intend to
address anyway. This is most often the case with CI, such as with

https://travis-ci.org/todb-r7/metasploit-framework
bug/bundler_fix
Tod Beardsley 2014-05-21 16:20:57 -05:00
parent 765419627b
commit d9fbf861d2
No known key found for this signature in database
GPG Key ID: 1EFFB682ADB9F193
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,7 @@ require 'find'
require 'time'
CHECK_OLD_RUBIES = !!ENV['MSF_CHECK_OLD_RUBIES']
SUPRESS_INFO_MESSAGES = !!ENV['MSF_SUPPRESS_INFO_MESSAGES']
if CHECK_OLD_RUBIES
require 'rvm'
@ -91,6 +92,7 @@ class Msftidy
# Display an info message. Info messages do not alter the exit status.
#
def info(txt, line=0)
return if SUPRESS_INFO_MESSAGES
line_msg = (line>0) ? ":#{line}" : ''
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
end