sapience 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -0
- data/lib/sapience/logger.rb +2 -2
- data/lib/sapience/sapience.rb +4 -0
- data/lib/sapience/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2171e090ce8a04ee2d96e24e6e68ae617e2855e6
|
4
|
+
data.tar.gz: 9babc1421bcf9b6adc12c1a4b6db45646fa2b8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 169fb6071907dbf7c9838c97e862d7f5672ee5071a04bcf0a960d75ddb4e1489b9fe9899e25306e179ca26143f4babafe45ad8f2bca7873358b3849a1d4dd67d
|
7
|
+
data.tar.gz: fea5d04f8247186909e3855363310e277e92e245654adcae56195aec046f8994ec99e8d2e50a615f1ae4b2a36476d7fc9b2d2f65eb2e0f82c8eb896829b4fd1b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -108,6 +108,15 @@ Sapience.add_appender(
|
|
108
108
|
)
|
109
109
|
```
|
110
110
|
|
111
|
+
#### Test exceptions
|
112
|
+
|
113
|
+
If you want to quickly verify that your appenders are handling exceptions properly. You can use the following method to
|
114
|
+
generate and log an exception at any given level.
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
Sapience.test_exception(:error)
|
118
|
+
```
|
119
|
+
|
111
120
|
### Datadog
|
112
121
|
|
113
122
|
Datadog is a slightly modified version of statsd. On top of the standard statsd API it has support for events.
|
data/lib/sapience/logger.rb
CHANGED
@@ -107,10 +107,10 @@ module Sapience
|
|
107
107
|
def log(log, message = nil, progname = nil, &block)
|
108
108
|
# Compatibility with ::Logger
|
109
109
|
return add(log, message, progname, &block) unless log.is_a?(Sapience::Log)
|
110
|
-
@@appender_thread
|
110
|
+
@@appender_thread << lambda do
|
111
111
|
Sapience.appenders.each do |appender|
|
112
112
|
begin
|
113
|
-
appender.log(
|
113
|
+
appender.log(log)
|
114
114
|
rescue StandardError => exc
|
115
115
|
logger.error "Appender thread: Failed to log to appender: #{appender.inspect}", exc
|
116
116
|
end
|
data/lib/sapience/sapience.rb
CHANGED
@@ -225,6 +225,10 @@ module Sapience
|
|
225
225
|
@@logger ||= Sapience::Logger.logger
|
226
226
|
end
|
227
227
|
|
228
|
+
def self.test_exception(level = :error)
|
229
|
+
Sapience[self].public_send(level, Exception.new("Sapience Test Exception"))
|
230
|
+
end
|
231
|
+
|
228
232
|
# Wait until all queued log messages have been written and flush all active
|
229
233
|
# appenders
|
230
234
|
def self.flush
|
data/lib/sapience/version.rb
CHANGED