Sha256: f834a36f7a48341db98751a6e31a9ca91c809054dc4ce7e521066724f71e01fb

Contents?: true

Size: 1.42 KB

Versions: 12

Compression:

Stored size: 1.42 KB

Contents

# Roqua::Support

This gem contains all sorts of support utilities and helper methods that are
useful to have in RoQua's applications, but have nothing to with the domain.

## Usage

### Logging

```ruby
class Example
  include Roqua::Logging

  def methodname
    # This writes a single line to the event log with
    # the given event name and parameters as key=value format.
    eventlog.info 'example.eventname', optional: 'extra parameters'
  end

  def another
    # This automatically emits two lines, one for when the
    # block begins, one for when the block ends. ':started',
    # ':finished', ':failed' are appended to the event name
    # given, and the duration of the block is logged with
    # the :finished log line.
    eventlog.lifecycle 'example.lifecycle', optional: 'params' do
      sleep 5
    end
  end

  def third
    # This example is the same as the `another` example.
    sleep 5
  end
  log :third, 'example.lifecycle', optional: 'params'
end
```

### Rails logger

You can also add an additional request logger by adding this to `config/initializers/request_logger.rb`:

```ruby
require 'roqua/support/request_logger'
Roqua::Support::RequestLogger.attach_to :action_controller
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
roqua-support-0.1.9 README.md
roqua-support-0.1.8 README.md
roqua-support-0.1.7 README.md
roqua-support-0.1.6 README.md
roqua-support-0.1.5 README.md
roqua-support-0.1.4 README.md
roqua-support-0.1.3 README.md
roqua-support-0.1.2.2 README.md
roqua-support-0.1.2.1 README.md
roqua-support-0.1.2 README.md
roqua-support-0.1.1 README.md
roqua-support-0.1.0 README.md