Method: Ektoplayer::Application.log
- Defined in:
- lib/ektoplayer/application.rb
.log(from, *msgs) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ektoplayer/application.rb', line 43 def self.log(from, *msgs) func = caller[0][/`.*'/][1..-2] from = from.class unless from.is_a?String $stderr.puts("#{DateTime.now.rfc3339} #{from}.#{func}: " + msgs.join(' ')) if e = msgs.select { |m| m.kind_of?Exception }[0] $stderr.puts "#{e.backtrace.first}: #{e.} (#{e.class})", e.backtrace.join(?\n) end $stderr.flush end |