Object
Stores mole information to a log file or dump it to the console. All available mole info will dumped to the logger.
| file_name | Specifies a file to send the logs to. By default mole info |
will be sent out to stdout.
# File lib/rackamole/store/log.rb, line 10
10: def initialize( file_name=$stdout )
11: @logger = Rackamole::Logger.new( :log_file => file_name )
12: end
Dump mole info to logger
| attrs | The available moled information for a given feature |
# File lib/rackamole/store/log.rb, line 18
18: def mole( attrs )
19: return if attrs.empty?
20:
21: display_head( attrs )
22: display_commons( attrs )
23: rescue => mole_boom
24: log.error "MOLE STORE CRAPPED OUT -- #{mole_boom}"
25: log.error mole_boom.backtrace.join( "\n " )
26: end
dump moled info to log
# File lib/rackamole/store/log.rb, line 32
32: def display_commons( args )
33: args.each do |k,v|
34: display_info( k.to_s.capitalize, v.inspect )
35: end
36: end
Display mole type
# File lib/rackamole/store/log.rb, line 47
47: def display_head( args )
48: log.info "-"*100
49: log.info case args[:type]
50: when Rackamole.feature
51: "FEATURE"
52: when Rackamole.fault
53: "FAULT"
54: when Rackamole.perf
55: "PERFORMANCE"
56: end
57: end
Output formating...
# File lib/rackamole/store/log.rb, line 60
60: def display_info( key, value )
61: log.info "%-#{spacer}s : %s" % [key, value]
62: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.