Hatchet

Ruby logging library that provides the ability to add class/module specific filters

View the Project on GitHub gshutler/hatchet

Navigation


Build status


Hosted on GitHub Pages — Theme by orderedlist

Standard Installation

Bundler-Enabled Applications

Add this line to your application’s Gemfile:

gem 'hatchet'

And then execute:

$ bundle

If you are using Bundler to require your gems then Hatchet should now be available. Otherwise, you will need to require the Hatchet gem explicitly:

require 'hatchet'

Non-Bundler Applications

First you must install the gem:

$ gem install hatchet

Then you must require the gem from with your application:

require 'hatchet'

Adding To Classes

To make Hatchet’s logging method available within a class you must include the Hatchet module:

class MyClass
  include Hatchet
end

Adding To Modules

To make Hatchet’s logging method available within a module you must extend the module with Hatchet:

class MyModule
  include Hatchet
end

Using With Scripts

Hatchet can also be used with scripts by including the Hatchet module at the top level:

include Hatchet

Configuration

Configuration is done via the standard configuration mechanism. Where this is done depends on how you have laid out your application but you should ensure that Hatchet is configured before you try and use it to log messages.