module Arachni::UI::Output
Basically provides us with {#print_error error logging} and the ability to reroute all other messages to a logfile.
@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>
Provides a blackhole output interface which is loaded when Arachni
is not driven by a UI
but being scripted.
@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>
Public Class Methods
reset_output_options()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 32 def self.reset_output_options end
Public Instance Methods
debug?(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 108 def debug?(*) end
debug_level_1?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 75 def debug_level_1? debug? 1 end
debug_level_2?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 78 def debug_level_2? debug? 2 end
debug_level_3?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 81 def debug_level_3? debug? 3 end
debug_level_4?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 84 def debug_level_4? debug? 4 end
debug_off()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 105 def debug_off end
debug_on(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 101 def debug_on(*) end
Also aliased as: debug
disable_only_positives()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 119 def disable_only_positives end
included( base )
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 18 def included( base ) base.extend ClassMethods end
mute()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 125 def mute end
muted?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 131 def muted? end
only_positives()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 116 def only_positives end
only_positives?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 122 def only_positives? end
print_bad( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 28 def print_bad( str = '' ) push_to_output_buffer( bad: str ) end
print_debug( str = '', level = 1 )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 46 def print_debug( str = '', level = 1 ) return if !debug?( level ) push_to_output_buffer( debug: str ) end
print_debug_backtrace(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 69 def print_debug_backtrace(*) end
print_debug_level_1( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 51 def print_debug_level_1( str = '' ) print_debug( str, 1 ) end
print_debug_level_2( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 55 def print_debug_level_2( str = '' ) print_debug( str, 2 ) end
print_debug_level_3( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 59 def print_debug_level_3( str = '' ) print_debug( str, 3 ) end
print_debug_level_4(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 66 def print_debug_level_4(*) end
print_error( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 23 def print_error( str = '' ) log_error( str ) push_to_output_buffer( error: str ) end
print_error_backtrace(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 72 def print_error_backtrace(*) end
print_exception(*)
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 39 def print_exception(*) end
print_info( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 37 def print_info( str = '' ) return if only_positives? push_to_output_buffer( info: str ) end
print_line( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 68 def print_line( str = '' ) return if only_positives? push_to_output_buffer( line: str ) end
print_ok( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 42 def print_ok( str = '' ) push_to_output_buffer( ok: str ) end
print_status( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 32 def print_status( str = '' ) return if only_positives? push_to_output_buffer( status: str ) end
print_verbose( str = '' )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 63 def print_verbose( str = '' ) return if !verbose? push_to_output_buffer( verbose: str ) end
reroute_to_file( file )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 73 def reroute_to_file( file ) @@reroute_to_file = file end
reroute_to_file?()
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 77 def reroute_to_file? @@reroute_to_file end
unmute()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 128 def unmute end
verbose?()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 98 def verbose? end
verbose_on()
click to toggle source
# File lib/arachni/ui/foo/output.rb, line 94 def verbose_on end
Also aliased as: verbose
Private Instance Methods
push_to_output_buffer( msg )
click to toggle source
# File lib/arachni/rpc/server/output.rb, line 83 def push_to_output_buffer( msg ) return if !@@reroute_to_file File.open( @@reroute_to_file, 'a+' ) do |f| type = msg.keys[0] str = msg.values[0] f.write( "[#{Time.now.asctime}] [#{type}] #{str}\n" ) end end