Skip to content

rustybailey/paul_bunyan

 
 

Repository files navigation

Paul Bunyan (formerly: Logging)

PaulBunyan is a re-usable component with a globally accessible Logger with extra support for handling logging in Rails.

class Foo
  include PaulBunyan

  def bar
    logger.warn "blah"
  end
end

Also included is a Railtie that overrides the default rails logger to always print to STDOUT as well as format the messages to JSON for machine readable goodness. This has been tested with Rails 4.2 but should compatible with Rails 3 or newer since that's when Railties were introduced.

Installation

Add this line to your application's Gemfile:

gem 'paul_bunyan'

And then execute:

$ bundle

Or install it yourself as:

$ gem install paul_bunyan

Usage

Non-Rails projects:

require 'paul_bunyan'

include PaulBunyan::Logger

PaulBunyan.set_logger(STDOUT)

logger.warn "blah"

Rails projects:

Nothing after it's added to your Gemfile, the Railtie takes care of the rest.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 92.7%
  • HTML 5.7%
  • Other 1.6%