1

I'm creating a quite complex app with really complicated and heavy background processing workers. It's all about video transcoding and doing a lot of other stuff with large video files so i need to make sure all the log messages are easily accessible and legible. Browsing sidekiq.log file here is not an option for me.

The best solution i can imagine is make it working like output logger on Travis CI - which goes down to somehow capturing all the PUTS and LOGGER messages one by one and save them to the db (i have no idea if that's how are they doing this on travis but for me - it would be perfect).

The only helpful thread i've found on the internet is that question/answer How can I capture STDOUT to a string? but let's me just to save a whole output at the end of a whole process. What i need is saving the output one message by one (somehow listening for any puts/logger occurence?) and fireing a save method.

Any tips much appreciated.

Community
  • 1
  • 1
mbajur
  • 4,406
  • 5
  • 49
  • 79

1 Answers1

0

You probably need vx-common-spawn gem. It is part of open source "Vexor CI" project. It works like in readme:

spawn "ls -la" do |output| # here is your command that writes in stdout
  # This will be called each time something added to stdout
  print output             
end
mikdiet
  • 9,859
  • 8
  • 59
  • 68
  • sounds great but the problem is i'm not fireing a command by myself. It's fired by a gem method (i'm using Streamio-ffmpeg and i need to listen for ffmpeg output) so i just have access to `Streamio::Movie.new('..').transcode('new_file.mp4')` – mbajur Jun 05 '14 at 18:05