asenchi/scrolls — pull request #9 by fabiokung (2012-04-27 02:38:06+00:00)
Title: Scrolls::Decorators

See [test_decorators.rb](https://github.com/fabiokung/scrolls/blob/master/test/test_decorators.rb) for usage.

Example:

```ruby
class MyService
include Scrolls::Decorators

log_context "myservice", release: "v51"

def simple_log_with_context
log
# output: "myservice release=v51\n"
end

def basic_logging
log "basic", "that", "works", data: "useful", number: 10
# output: "myservice release=v51 basic that works data=useful number=10\n"
end

log
def wrapping
sleep 0.1
# output:
# "myservice release=v51 class=MyService method=wrapping at=start\n"
# "myservice release=v51 class=MyService method=wrapping at=finish elapsed=0.1"
end

# and more ...
end
```