prosopite 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -1
- data/lib/prosopite/version.rb +1 -1
- data/lib/prosopite.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc0695c895e2f636c3c2a2caa2c4b211cad0f7d57f8bd4842fbc534ba9e55190
|
4
|
+
data.tar.gz: 2dcd4426e5b792a58cee89ec601e3388bacc97cb0de57aa3b87dd7600dd6b020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2c1c6a4723c44c24ab800fede6c14d49f74ba1c97c4aa60c59a231725e001ca45416abb878331157402582114e144931e39774a9af51fb422d12ba4f668403b
|
7
|
+
data.tar.gz: 2175b7c1bd661c5bca41c1263e9a750d63b205e548ef1d2f13ca2aac43c6306eaad3e3bb8420e627ab2576821565311c525e6b51576b4e30431c41420b3b7f0b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -115,10 +115,34 @@ Or install it yourself as:
|
|
115
115
|
|
116
116
|
The preferred type of notifications can be configured with:
|
117
117
|
|
118
|
+
* `Prosopite.raise = true`: Raise warnings as exceptions
|
118
119
|
* `Prosopite.rails_logger = true`: Send warnings to the Rails log
|
119
120
|
* `Prosopite.prosopite_logger = true`: Send warnings to `log/prosopite.log`
|
120
121
|
* `Prosopite.stderr_logger = true`: Send warnings to STDERR
|
121
|
-
* `Prosopite.
|
122
|
+
* `Prosopite.custom_logger = my_custom_logger`:
|
123
|
+
|
124
|
+
### Custom Logging Configuration
|
125
|
+
|
126
|
+
You can supply a custom logger with the `Prosopite.custom_logger` setting.
|
127
|
+
|
128
|
+
This is useful for circumstances where you don't want your logs to be
|
129
|
+
highlighted with red, or you want logs sent to a custom location.
|
130
|
+
|
131
|
+
One common scenario is that you may be generating json logs and sending them to
|
132
|
+
Datadog, ELK stack, or similar, and don't want to have to remove the default red
|
133
|
+
escaping data from messages sent to the Rails logger, or want to tag them
|
134
|
+
differently with your own custom logger.
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
# Turns off logging with red highlights, but still sends them to the Rails logger
|
138
|
+
Prosopite.custom_logger = Rails.logger
|
139
|
+
```
|
140
|
+
|
141
|
+
```ruby
|
142
|
+
# Use a completely custom logging instance
|
143
|
+
Prosopite.custom_logger = MyLoggerClass.new
|
144
|
+
|
145
|
+
```
|
122
146
|
|
123
147
|
## Development Environment Usage
|
124
148
|
|
data/lib/prosopite/version.rb
CHANGED
data/lib/prosopite.rb
CHANGED
@@ -8,6 +8,7 @@ module Prosopite
|
|
8
8
|
:stderr_logger,
|
9
9
|
:rails_logger,
|
10
10
|
:prosopite_logger,
|
11
|
+
:custom_logger,
|
11
12
|
:allow_stack_paths,
|
12
13
|
:ignore_queries
|
13
14
|
|
@@ -155,6 +156,7 @@ module Prosopite
|
|
155
156
|
end
|
156
157
|
|
157
158
|
def send_notifications
|
159
|
+
@custom_logger ||= false
|
158
160
|
@rails_logger ||= false
|
159
161
|
@stderr_logger ||= false
|
160
162
|
@prosopite_logger ||= false
|
@@ -172,6 +174,8 @@ module Prosopite
|
|
172
174
|
notifications_str << "\n"
|
173
175
|
end
|
174
176
|
|
177
|
+
@custom_logger.warn(notifications_str) if @custom_logger
|
178
|
+
|
175
179
|
Rails.logger.warn(red(notifications_str)) if @rails_logger
|
176
180
|
$stderr.puts(red(notifications_str)) if @stderr_logger
|
177
181
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prosopite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mpampis Kostas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|