Reox is a simple stream logger library.
Ruby 💎
Just install the gem
gem install reox
Wrap the portion you want to record inside the record block
require 'reox'
Reox.record do
puts "I will be logged :)"
end
puts "I won't be logged"
will store it in output.log
as
This is a test
4556
If you want logs to be verbose
require 'reox'
Reox.record{verbose: true} do
puts "I will be logged :)"
end
puts "I won't be logged"
will store it in output.log
as
I, [2019-04-28T19:31:29.402618 #9435] INFO -- tester.rb:5:in `puts': This is a test
I, [2019-04-28T19:31:30.910717 #9435] INFO -- tester.rb:7:in `puts': 456
or Use it for whole code
require 'reox'
Reox.record! # or verbose mode Reox.record!({verbose: true})
puts "Everything will be logged"
puts "Unless we stop it, which is optinal "
Reox.stop! # Optional to stop recording
puts "Phew!, I escaped the logger "
This project is licensed under the MIT License - see the LICENSE file for details
- StackOverflow for the guidance and intial idea
- PurpleBooth's README Template