Files
metasploit-gs/lib/msf/core/module/ui/message.rb
T

41 lines
873 B
Ruby
Raw Normal View History

2014-10-16 09:39:30 -05:00
# Methods for print messages with status indicators
module Msf::Module::UI::Message
autoload :Verbose, 'msf/core/module/ui/message/verbose'
include Msf::Module::UI::Message::Verbose
2014-10-16 09:39:30 -05:00
def print_error(msg='')
super(print_prefix + msg)
end
2016-11-15 19:20:42 -06:00
alias_method :print_bad, :print_error
2014-10-16 09:39:30 -05:00
def print_good(msg='')
super(print_prefix + msg)
end
def print_prefix
2016-01-14 10:04:23 -06:00
prefix = ''
if datastore['TimestampOutput'] ||
(framework && framework.datastore['TimestampOutput'])
2016-01-14 10:04:23 -06:00
prefix << "[#{Time.now.strftime("%Y.%m.%d-%H:%M:%S")}] "
2014-10-16 09:39:30 -05:00
xn ||= datastore['ExploitNumber']
xn ||= framework.datastore['ExploitNumber']
if xn.is_a?(Integer)
2014-10-16 09:39:30 -05:00
prefix << "[%04d] " % xn
end
end
2016-01-14 10:04:23 -06:00
prefix
2014-10-16 09:39:30 -05:00
end
def print_status(msg='')
super(print_prefix + msg)
end
def print_warning(msg='')
super(print_prefix + msg)
end
2016-01-14 10:04:23 -06:00
end