Created
June 4, 2010 16:19
-
-
Save imajes/425611 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def initialize(path) | |
@file = path | |
puts self.class.to_s | |
puts Logger.new(STDOUT) | |
puts @logger = Logger.new("#{self.class.to_s}.log") | |
@logger.formatter = Logger::Formatter.new | |
puts "loggered" | |
require 'ruby-debug'; Debugger.start; Debugger.settings[:autoeval] = 1; Debugger.settings[:autolist] = 1; debugger | |
end | |
end | |
r = Foo.new(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output: | |
% ruby foo.rb | |
Foo | |
#<Logger:0x102fea710> | |
#<Logger:0x102fea5a8> | |
loggered | |
[66, 75] in foo.rb | |
66 | |
67 | |
68 end | |
69 | |
70 p = Foo.new("/Users/james/Desktop/alf_resource.txt") | |
=> 71 p.process! | |
foo.rb:71 | |
p.process! | |
(rdb:1) @logger | |
nil | |
(rdb:1) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment