Skip to content

Log your data (sql, json, text) to your console with built-in formatting and colorization for Ruby on Rails

License

Notifications You must be signed in to change notification settings

coderberry/whoop

Repository files navigation

Whoop

Gem Version Maintainability Test Coverage Tests CodeQL StandardRB GEM Version GEM Downloads Ruby Style Twitter Follow

Whoop is a Ruby logging library with built-in formatting and colorization.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add whoop

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install whoop

Configuration

You can configure the gem for you Rails app by adding an an initializer:

# config/initializers/whoop.rb
Whoop.setup do |config|
  config.logger = ActiveSupport::Logger.new("log/debug.log")
  # config.logger = ActiveSupport::Logger.new("log/#{Rails.env}.log")
  # config.logger = ActiveSupport::Logger.new($stdout)
  # config.logger = nil # uses `puts`
  
  config.level = :debug
  # config.level = :info
  # config.level = :warn
  # config.level = :error
end

Usage

The whoop method is accessible from any object. See specs for more examples.

whoop "Hello, World!"

Formatters

TODO

Colors

TODO

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/whoop. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Whoop project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Attribution

This project is maintained by Eric Berry.

This gem is based on the wrapped_print gem by Igor Kasyanchuk.

About

Log your data (sql, json, text) to your console with built-in formatting and colorization for Ruby on Rails

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages