tracer_client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tracer_client/changes.rb +5 -5
- data/lib/tracer_client/log.rb +6 -2
- data/lib/tracer_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7fe59b044f122fd47816154bfa58fc2264f7df2
|
4
|
+
data.tar.gz: 15fb0e53a246406873ae8301d230c2e92c7f1170
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6564603d864559b4693ee8c1fecea7d188e30a10ae0a42736394e45fb685e540d8193574379d777e947681fb20fe8a0a77ed288d27d4b1d46ec6ec191f30f777
|
7
|
+
data.tar.gz: c51d39df19da621c538208aa2db95dae7086fde3012d257e510f8a2d48d9ac968b7c3350ec4e7e7619cc4b6959f617edafb8efb5bbb7cdf5179ad73fbc78e0b3
|
@@ -18,7 +18,7 @@ module Tracer
|
|
18
18
|
[changes_logging_options[k]].flatten.compact.map { |attr| attr.is_a?(Hash) ? attr.stringify_keys : attr.to_s }
|
19
19
|
end
|
20
20
|
|
21
|
-
options_on = Array(options[:on]) # so that a single symbol can be passed in without wrapping it in an `Array`
|
21
|
+
options_on = Array.wrap(options[:on]) # so that a single symbol can be passed in without wrapping it in an `Array`
|
22
22
|
|
23
23
|
after_create :log_create, :if => :log_changes? if options_on.empty? || options_on.include?(:create)
|
24
24
|
|
@@ -44,7 +44,7 @@ module Tracer
|
|
44
44
|
event: 'create',
|
45
45
|
changes: changes_for_tracing,
|
46
46
|
)
|
47
|
-
rescue
|
47
|
+
rescue => e
|
48
48
|
Log.exception_with_alert(e, 'Ошибка регистрации создания', 'log_changes create',
|
49
49
|
item_id: id,
|
50
50
|
item_type: self.class.base_class.name)
|
@@ -61,7 +61,7 @@ module Tracer
|
|
61
61
|
changes: changes_for_tracing,
|
62
62
|
)
|
63
63
|
end
|
64
|
-
rescue
|
64
|
+
rescue => e
|
65
65
|
Log.exception_with_alert(e, 'Ошибка регистрации изменения', 'log_changes update',
|
66
66
|
item_id: id,
|
67
67
|
item_type: self.class.base_class.name)
|
@@ -77,7 +77,7 @@ module Tracer
|
|
77
77
|
object: object_attrs_for_tracing(item_before_change),
|
78
78
|
)
|
79
79
|
end
|
80
|
-
rescue
|
80
|
+
rescue => e
|
81
81
|
Log.exception_with_alert(e, 'Ошибка регистрации удаления', 'log_changes destroy',
|
82
82
|
item_id: id,
|
83
83
|
item_type: self.class.base_class.name)
|
@@ -127,7 +127,7 @@ module Tracer
|
|
127
127
|
previous = self.dup
|
128
128
|
# `dup` clears timestamps so we add them back.
|
129
129
|
all_timestamp_attributes.each do |column|
|
130
|
-
previous[column] = send(column) if self.class.column_names.include?(column.to_s) and not
|
130
|
+
previous[column] = send(column) if self.class.column_names.include?(column.to_s) and not try(column).nil?
|
131
131
|
end
|
132
132
|
previous.tap do |prev|
|
133
133
|
prev.id = id # `dup` clears the `id` so we add that back
|
data/lib/tracer_client/log.rb
CHANGED
@@ -57,8 +57,12 @@ module Log
|
|
57
57
|
|
58
58
|
|
59
59
|
def self.exception(exception, subject, tags = '', data = {})
|
60
|
-
|
61
|
-
|
60
|
+
if Rails.env.development?
|
61
|
+
raise exception
|
62
|
+
else
|
63
|
+
exception_message(exception, :crit, subject, tags, data, exception.backtrace)
|
64
|
+
exception
|
65
|
+
end
|
62
66
|
end
|
63
67
|
|
64
68
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracer_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serge Galanin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: config
|