README.mdown in multiple_devices_logger-1.0.0 vs README.mdown in multiple_devices_logger-1.1.0

- old
+ new

@@ -66,9 +66,29 @@ ```ruby logger.clear_devices ``` +### Custom formatter for each severity + +`MultipleDevicesLogger` allows you to configure a formatter for each +severity via `#set_formatter` method, here is some examples: + +```ruby +# Specify formatter as a block +logger.set_formatter(:debug) { |severity, time, progname, message| "[#{severity}] #{message}" } + +# Formatter can also be specified as first argument +my_formatter = -> { |severity, time, progname, message| "#{progname} -> #{message} @ #{time}" } +logger.set_formatter(my_formatter, Logger::ERROR) + +# Operators can also be used +logger.set_formatter('>= warn') { |severity, time, progname, message| "[#{severity}] #{message}" } + +# Like #add_device, many severities can be specified +logger.set_formatter(:debug, :info) { |severity, time, progname, message| "[#{severity}] #{message}" } +``` + ## Executing test suite This project is fully tested with [Rspec 3](http://github.com/rspec/rspec). Just run `bundle exec rake` (after a `bundle install`).