lib/syslogstash/worker.rb in syslogstash-0.2.0 vs lib/syslogstash/worker.rb in syslogstash-0.3.0
- old
+ new
@@ -8,23 +8,27 @@
@worker.join
@worker = nil
end
end
+ def thread
+ @worker
+ end
+
# If you want to wait for a reader to die, here's how.
#
def wait
@worker.join
end
private
def log
- puts "#{Time.now.strftime("%F %T.%L")} #{self.class} #{yield.to_s}"
+ $stderr.puts "#{Time.now.strftime("%F %T.%L")} #{self.class} #{yield.to_s}"
end
def debug
if ENV['DEBUG_SYSLOGSTASH']
- puts "#{Time.now.strftime("%F %T.%L")} #{self.class} #{yield.to_s}"
+ $stderr.puts "#{Time.now.strftime("%F %T.%L")} #{self.class} #{yield.to_s}"
end
end
end