You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+71-68
Original file line number
Diff line number
Diff line change
@@ -127,29 +127,6 @@ The preferred type of notifications can be configured with:
127
127
*`Prosopite.custom_logger = my_custom_logger`: Set a custom logger. See the following section for the details. Defaults to `false`.
128
128
*`Prosopite.enabled = true`: Enables or disables the gem. Defaults to `true`.
129
129
130
-
### Custom Logging Configuration
131
-
132
-
You can supply a custom logger with the `Prosopite.custom_logger` setting.
133
-
134
-
This is useful for circumstances where you don't want your logs to be
135
-
highlighted with red, or you want logs sent to a custom location.
136
-
137
-
One common scenario is that you may be generating json logs and sending them to
138
-
Datadog, ELK stack, or similar, and don't want to have to remove the default red
139
-
escaping data from messages sent to the Rails logger, or want to tag them
140
-
differently with your own custom logger.
141
-
142
-
```ruby
143
-
# Turns off logging with red highlights, but still sends them to the Rails logger
144
-
Prosopite.custom_logger =Rails.logger
145
-
```
146
-
147
-
```ruby
148
-
# Use a completely custom logging instance
149
-
Prosopite.custom_logger =MyLoggerClass.new
150
-
151
-
```
152
-
153
130
## Development Environment Usage
154
131
155
132
Prosopite auto-detection can be enabled on all controllers:
@@ -177,51 +154,6 @@ config.after_initialize do
177
154
Prosopite.rails_logger =true
178
155
end
179
156
```
180
-
In some cases you may want to configure prosopite to not raise by default and only raise in certain scenarios. In this example we scan on all controllers but also provide an API to only raise on specific actions.
@books=Book.all.map(&:author) # This will raise N+1 errors
218
-
end
219
-
220
-
defshow
221
-
@book=Book.find(params[:id])
222
-
@book.reviews.map(&:author) # This will not raise N+1 errors
223
-
end
224
-
end
225
157
```
226
158
## Test Environment Usage
227
159
@@ -363,6 +295,77 @@ Pauses can be ignored with `Prosopite.ignore_pauses = true` in case you want to
363
295
An example of when you might use this is if you are [testing Active Jobs inline](https://guides.rubyonrails.org/testing.html#testing-jobs),
364
296
and don't want to run Prosopite on background job code, just foreground app code. In that case you could write an [Active Job callback](https://edgeguides.rubyonrails.org/active_job_basics.html#callbacks) that pauses the scan while the job is running.
365
297
298
+
## Local Raise
299
+
300
+
In some cases you may want to configure prosopite to not raise by default and only raise in certain scenarios.
301
+
In this example we scan on all controllers but also provide an API to only raise on specific actions.
0 commit comments