Injects a proxy allowing the use of custom logging libraries and settings.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
README.textile
Rakefile
merb_proxy_logger.gemspec

README.textile

merb_proxy_logger

Injects a proxy allowing the use of custom logging libraries and settings.

Getting Going

Once the Gem has been installed (see below), you will want to add the plugin
as a dependency in config/init.rb:


  # ==== Dependencies
  
  load_dependency "merb_proxy_logger"

NOTE: Unlike most other dependencies, load_dependency is required for the
use_logger method to be available.

Then further in:


  use_logger :Logger do |logger, (file, level, delimiter, auto_flush)|
    logger = logger.new(STDOUT) # file, level, delimiter, auto_flush
    logger.formatter = proc{|s,t,p,m|"%5s [%s] (%s : %s) %s :: %s\n" % [s, t.strftime("%Y-%m-%d %H:%M:%S"), $$, Thread.current.object_id, p, m]}
    logger.level = Logger.const_get(level.to_s.upcase.to_sym)
    logger.progname = "ScoutMerb"
    logger
  end

NOTE: It’s a little repetitive and hopefully this will be minimized in the
future, but for now it’s necessary. Also, make sure you return the logger
object fully initialized.

Requirements

This plugin was made with Merb 0.9.7 and above in mind and has not been tested
in other contexts. It requires certain recent changes to the bootloading
mechanism and won’t work if these are not available.

Install

Install gem from GitHub:


  $ sudo gem install mtodd-merb_proxy_logger --source http://gems.github.com/

or install from source:


  $ rake install

License

(The MIT License)

Copyright © 2008 Matt Todd, Highgroove Studios.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the ‘Software’), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.