getaround_utils 0.2.31 → 0.2.32
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/getaround_utils/mixins/loggable.rb +8 -8
- data/lib/getaround_utils/version.rb +1 -1
- 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: cc5afe4eb1c9c41834c986fb49c298a03d01e122d02743b33d91e3185590b4db
|
4
|
+
data.tar.gz: 4ee697023c29ba969299fc1b0177c1052481af226fbb3e2e06eebaf7c3de0441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83f65776ac17550135c057a4a8dc9422cdff4ca1f93a151075550d329009553c0c8fe1e740018602b51fead189912d1afa33213c3008c2f192c8bf073a7b22f
|
7
|
+
data.tar.gz: cde7ef071440c8449802f195ddd88a57339175ebcec93aafe6bae3c469f99f6cd31379f9ee1dca5a95ba41eda5dcb38a19acb89914cb0dc8e62be6c88acb1e7a
|
data/Gemfile.lock
CHANGED
@@ -6,12 +6,12 @@ module GetaroundUtils; end
|
|
6
6
|
module GetaroundUtils::Mixins; end
|
7
7
|
|
8
8
|
module GetaroundUtils::Mixins::Loggable
|
9
|
-
def
|
10
|
-
@
|
9
|
+
def loggable_class_name
|
10
|
+
@loggable_class_name ||= is_a?(Class) ? name : self.class.name
|
11
11
|
end
|
12
12
|
|
13
13
|
def base_append_infos_to_loggable(payload)
|
14
|
-
payload[:origin] =
|
14
|
+
payload[:origin] = loggable_class_name
|
15
15
|
return unless respond_to?(:append_infos_to_loggable)
|
16
16
|
|
17
17
|
append_infos_to_loggable(payload)
|
@@ -38,27 +38,27 @@ module GetaroundUtils::Mixins::Loggable
|
|
38
38
|
|
39
39
|
loggable_log(
|
40
40
|
:info,
|
41
|
-
|
41
|
+
monitorable_log_message(event_name),
|
42
42
|
alert_threshold: monitorable_threshold,
|
43
43
|
**options
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
47
|
def monitorable_threshold(event_name)
|
48
|
-
monitorable_threshold = ENV["#{
|
49
|
-
if monitorable_threshold.nil? &&
|
48
|
+
monitorable_threshold = ENV["#{monitorable_log_message(event_name)}_threshold".upcase]&.to_i
|
49
|
+
if monitorable_threshold.nil? && monitorable_rails_config_defined?
|
50
50
|
monitorable_threshold = Rails.application.config.monitorable_log_thresholds&.dig(event_name.to_sym)
|
51
51
|
end
|
52
52
|
monitorable_threshold
|
53
53
|
end
|
54
54
|
|
55
|
-
def
|
55
|
+
def monitorable_log_message(event_name)
|
56
56
|
MONITORABLE_LOG_PREFIX + event_name
|
57
57
|
end
|
58
58
|
|
59
59
|
private
|
60
60
|
|
61
|
-
def
|
61
|
+
def monitorable_rails_config_defined?
|
62
62
|
defined?(Rails) &&
|
63
63
|
Rails.application.config.respond_to?(:monitorable_log_thresholds) &&
|
64
64
|
Rails.application.config.monitorable_log_thresholds.respond_to?(:dig)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getaround_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drivy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|