Skip to content

Commit d9fbf86

Browse files
author
Tod Beardsley
committed
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
1 parent 7654196 commit d9fbf86

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/msftidy.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
require 'time'
1212

1313
CHECK_OLD_RUBIES = !!ENV['MSF_CHECK_OLD_RUBIES']
14+
SUPRESS_INFO_MESSAGES = !!ENV['MSF_SUPPRESS_INFO_MESSAGES']
1415

1516
if CHECK_OLD_RUBIES
1617
require 'rvm'
@@ -91,6 +92,7 @@ def fixed(txt, line=0)
9192
# Display an info message. Info messages do not alter the exit status.
9293
#
9394
def info(txt, line=0)
95+
return if SUPRESS_INFO_MESSAGES
9496
line_msg = (line>0) ? ":#{line}" : ''
9597
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
9698
end

0 commit comments

Comments
 (0)