Skip to content

Commit

Permalink
Merge pull request #184 from yujideveloper/update-document-and-spec
Browse files Browse the repository at this point in the history
Update README and spec for v0.4.0 or later (ref #172)
  • Loading branch information
benlovell authored Jul 5, 2016
2 parents 38ed02b + d4b6b79 commit c0f4315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Completed 200 OK in 79ms (Views: 78.8ms | ActiveRecord: 0.0ms)
you get a single line with all the important information, like this:

```
method=GET path=/jobs/833552.json format=json controller=jobs action=show status=200 duration=58.33 view=40.43 db=15.26
method=GET path=/jobs/833552.json format=json controller=JobsController action=show status=200 duration=58.33 view=40.43 db=15.26
```

The second line is easy to grasp with a single glance and still includes all the
Expand Down Expand Up @@ -125,7 +125,7 @@ actions, or you can write a custom handler to skip messages based on data in the
MyApp::Application.configure do
config.lograge.enabled = true

config.lograge.ignore_actions = ['home#index', 'aController#anAction']
config.lograge.ignore_actions = ['HomeController#index', 'AController#an_action']
config.lograge.ignore_custom = lambda do |event|
# return true here if you want to ignore based on the event
end
Expand Down
14 changes: 7 additions & 7 deletions spec/lograge_logsubscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Time.now,
2,
status: 200,
controller: 'home',
controller: 'HomeController',
action: 'index',
format: 'application/json',
method: 'GET',
Expand Down Expand Up @@ -122,7 +122,7 @@

it 'includes the controller and action' do
subscriber.process_action(event)
expect(log_output.string).to include('controller=home action=index')
expect(log_output.string).to include('controller=HomeController action=index')
end

it 'includes the duration' do
Expand Down Expand Up @@ -261,33 +261,33 @@
end

it 'does not log ignored controller actions given a single ignored action' do
Lograge.ignore_actions 'home#index'
Lograge.ignore_actions 'HomeController#index'
subscriber.process_action(event)
expect(log_output.string).to be_blank
end

it 'does not log ignored controller actions given a single ignored action after a custom ignore' do
Lograge.ignore(->(_event) { false })

Lograge.ignore_actions 'home#index'
Lograge.ignore_actions 'HomeController#index'
subscriber.process_action(event)
expect(log_output.string).to be_blank
end

it 'logs non-ignored controller actions given a single ignored action' do
Lograge.ignore_actions 'foo#bar'
Lograge.ignore_actions 'FooController#bar'
subscriber.process_action(event)
expect(log_output.string).to be_present
end

it 'does not log ignored controller actions given multiple ignored actions' do
Lograge.ignore_actions ['foo#bar', 'home#index', 'bar#foo']
Lograge.ignore_actions ['FooController#bar', 'HomeController#index', 'BarController#foo']
subscriber.process_action(event)
expect(log_output.string).to be_blank
end

it 'logs non-ignored controller actions given multiple ignored actions' do
Lograge.ignore_actions ['foo#bar', 'bar#foo']
Lograge.ignore_actions ['FooController#bar', 'BarController#foo']
subscriber.process_action(event)
expect(log_output.string).to_not be_blank
end
Expand Down

0 comments on commit c0f4315

Please sign in to comment.