dogcatcher 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.travis.yml +2 -0
- data/README.md +10 -0
- data/lib/dogcatcher/config.rb +4 -0
- data/lib/dogcatcher/notice.rb +3 -0
- data/lib/dogcatcher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDkyOTc3ZmMyOWNhYTMyYzc1YTJlODI2OWEzZjgwNGI4ZGYzZjI5Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzIyMDAzNzlkMDA0MTZjODhjMTdlOWYzYjU4ZTJjZDE3ZmU4ZmU4ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzdlZWE1MGVjYzllMWFjNmE4ZTY2MWFlNTFkNWMyYWNkNzVjODcxMDM3M2Zi
|
10
|
+
ZjdhZWFiMDdjZWFiYTU2OGYyMTU1YzYyYTQ1YTc1OTJiY2JjMDFiOTZmZmMw
|
11
|
+
OWQzNGM0ODNhZGM2YjYzYjEwZGE2YTkzMjNjZWExZWEyOTg3YzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzJlMjQyMWQwMmUyYzhjODUxOGU0NWFhZWI0NzgxNGE0N2M3YzVmY2U2ZDVi
|
14
|
+
ZGQ5ZmI3OTNjYjU0MjdhZDA3NmJlMjY3MjBjYzgzNjM1OGZkOTkyMDZmYzAx
|
15
|
+
YmJlMDc0ODFkMjdiYTU1NWEyNGM4YjQwMWNiZTNlMmI3MzZmNzY=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -37,6 +37,7 @@ begin
|
|
37
37
|
fail ArgumentError, 'Example error'
|
38
38
|
rescue ArgumentError => exception
|
39
39
|
Dogcatcher.notify(exception)
|
40
|
+
raise exception
|
40
41
|
end
|
41
42
|
```
|
42
43
|
|
@@ -115,6 +116,15 @@ Dogcatcher.configure do |c|
|
|
115
116
|
end
|
116
117
|
```
|
117
118
|
|
119
|
+
Custom tags can be sent with exception events by adding them to the config.
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
Dogcatcher.configure do |c|
|
123
|
+
c.custom_tags = ['key1:value1']
|
124
|
+
c.custom_tags << 'key2:value2'
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
118
128
|
## Contributing
|
119
129
|
|
120
130
|
Bug reports and pull requests are welcome on GitHub at https://github.com/zl4bv/dogcatcher.
|
data/lib/dogcatcher/config.rb
CHANGED
@@ -34,11 +34,15 @@ module Dogcatcher
|
|
34
34
|
# By default it does no cleaning.
|
35
35
|
attr_accessor :backtrace_cleaner
|
36
36
|
|
37
|
+
# Custom tags to send with exception events
|
38
|
+
attr_accessor :custom_tags
|
39
|
+
|
37
40
|
def initialize
|
38
41
|
@statsd_host = '127.0.0.1'
|
39
42
|
@statsd_port = 8125
|
40
43
|
@gem_tags = true
|
41
44
|
@backtrace_cleaner = ActiveSupport::BacktraceCleaner.new
|
45
|
+
@custom_tags = []
|
42
46
|
end
|
43
47
|
|
44
48
|
# Adds a backtrace filter. The given line in the backtrace will be replaced
|
data/lib/dogcatcher/notice.rb
CHANGED
@@ -40,7 +40,10 @@ module Dogcatcher
|
|
40
40
|
arr << "notifier:#{notifier}"
|
41
41
|
arr << "action:#{action}"
|
42
42
|
arr << "exception_class:#{exception.class}"
|
43
|
+
arr << "program:#{@config.program}" if @config.program
|
44
|
+
arr << "ruby_version:#{RUBY_VERSION}"
|
43
45
|
arr << gem_tags if @config.gem_tags
|
46
|
+
arr.push(*@config.custom_tags)
|
44
47
|
arr.flatten
|
45
48
|
end
|
46
49
|
|
data/lib/dogcatcher/version.rb
CHANGED