lib/flashplayer/log_file.rb in flashsdk-1.0.5.pre vs lib/flashplayer/log_file.rb in flashsdk-1.0.12.pre
- old
+ new
@@ -4,11 +4,12 @@
class LogFile
attr_accessor :logger
def initialize
- @logger = $stdout
+ @logger = $stdout
+ super
end
def tail thread=nil
tail_path flashlog_path, thread
end
@@ -24,16 +25,14 @@
def read_flashlog_at path, thread=nil
thread ||= fake_thread
lines_put = 0
- trap("INT") { thread.kill }
-
while thread.alive? do
lines_put = read_from_file path, lines_put
logger.flush
- sleep(0.2)
+ sleep(0.1)
end
logger.puts ""
logger.puts ">> Exiting from tailing '#{path}' at user request"
end
@@ -83,10 +82,10 @@
end
end
end
-desc "Tail the flashlog.txt and block"
+desc "Tail the flashlog.txt and block (until CTRL+C)"
task :flashlog do
mm_config = FlashPlayer::MMConfig.new
mm_config.create
reader = FlashPlayer::LogFile.new
reader.tail