Ruby logging library that provides the ability to add class/module specific filters
View the Project on GitHub gshutler/hatchet
Hosted on GitHub Pages — Theme by orderedlist
Add this line to your application’s Gemfile to get Hatchet from RubyGems.org:
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:
First you must install the gem from RubyGems.org:
$ gem install hatchet
Then you must require the gem from with your application:
Hatchet comes with the hook required to add itself as a helper. Once you have required the Hatchet gem you can register Hatchet as a helper:
Alternatively, if you are using a class-based style of application you can include it in the individual classes:
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.
When logging messages you may need to use the log
alias as Sinatra defines its
own logger
method.