‘Hop across the logs’
Navigating your log files can feel like you are crossing a busy road while attempting to avoid the cars.
Frogger makes your log files more fun by adding some 8 bit colour and some nice formatting.
I created frogger after squinting at the log tail so many times and feeling like a complete idiot as I searched for a needle in a haystack.
I thought surely this can be more fun.
Other log enhancing gems are all about tracking performance and other such tasks.
Frogger is not about speed, it’s about getting through the logs with the least amount of pain.
What it does
Run a cucumber feature and tail your log file, the scenario name and step names will be annotated in your log file in glorious 8 bit colour.
Add this to your Gemfile within the Group ‘:test’, like so:
Group :test do gem 'frogger' # Put him somewhere inside the :test group cause he's happiest there end
Windows users: You will need the Win32 Console Ansi gem. Get it by running this from the command line:
gem install win32console
Just tail your log files like you usually do.
$ tail -f /log/test.log
Then run your cucumber tests
$ bundle exec cucumber
And be amazed as your log files become just a little more fun. Disclaimer: Increased fun may vary from developer to developer.
How do I know if it’s working?
You should see newly added colour section headings in your tailed log which match the names of your cucumber Scenarios and Steps.
Richie Khoo is a developer from Melbourne, Australia. Don’t be shy, you can follow me on twitter via @evolve2k
Special thanks to:
Pat Allan, Keith Pitt, Jared Fraser, Thomas Sinclair, Mark Ryall, Nathan Sampimon and everyone else at Australian Rails Camp 9 who helped me with the code and understanding the inner workings of Cucumber.
- Requires Cucumber 0.10.0 and above. (If it’s not working it’s probably because you have an older version of Cucumber.)
- Works with Rails 2.x and Rails 3.x
- Sinatra and other frameworks are currently not supported because it uses the Rails logger. (Pull requests welcome!)
Contributing to frogger
- Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet
- Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it
- Fork the project
- Start a feature/bugfix branch
- Commit and push until you are happy with your contribution
- Make sure to add rspec tests for it. This is important so I don’t break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright © 2011 Richie Khoo. See LICENSE.txt for further details.