uc3-dmp-cloudwatch 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f71f6ea7b2f3dc39de9eab5bf201e93899cb1537ca935a144d5e4eb5e9e42d9c
4
- data.tar.gz: 9dcc25d1cb233a77508d35541bf217ebf43834bbbdf01039c71e196333c97ca3
3
+ metadata.gz: f701bf03b8b203bdfcd558b7522874bcefaa4ef8abaa226847f74b5b951dd5b1
4
+ data.tar.gz: 1f836464c0a303cbfbdd7a51d5a00767183279f8b5519d59b42dbcb93608d07f
5
5
  SHA512:
6
- metadata.gz: 272f2017c217f5f79fb92e5b22e589f16df76d7a77af39bb964a5ad833dea458187d67809ed9e19917b5ddbab9271efc0d2ddce3137be85776fb044dca9a09c7
7
- data.tar.gz: 3ffe51067739dc79e82222f1631f0717d77c9a752507f0191118987bd3f55ca55dfea7b77af01a29c249355a89d604852dbad5a7db26feba3814a2f3f6fc47f3
6
+ metadata.gz: 710f72b0cc00921b934c312e784758d95d99ac318829379980d311350a4a7008ac17e3b38c989643d1b5eb4c6a7de044c4b59b6380218bbb31a7a004e2eb73f6
7
+ data.tar.gz: 6e83876f6f78f14ad96392c4502beda322c8cb9d19c4489a1c20a113cd341d5a6c2ad84bed5e3b9c155c0e782c072111146cd71717f3ad837e7178602c32bb9f
@@ -22,7 +22,7 @@ module Uc3DmpCloudwatch
22
22
  return false if @level == 'none' || message.nil?
23
23
 
24
24
  _format_msg(mode: 'error', msg: message)
25
- _format_msg(mode: 'error', msg: details) unless details.nil? || (details.is_a?(Hash) && details.keys.empty?)
25
+ _format_msg(mode: 'error', msg: details) unless _valid_details(details: details)
26
26
  _log_event(mode: 'error')
27
27
  end
28
28
 
@@ -30,18 +30,26 @@ module Uc3DmpCloudwatch
30
30
  return false if %w[none error].include?(@level) || message.nil?
31
31
 
32
32
  _format_msg(mode: 'info', msg: message)
33
- _format_msg(mode: 'info', msg: details) unless details.nil? || (details.is_a?(Hash) && details.keys.empty?)
33
+ _format_msg(mode: 'info', msg: details) unless _valid_details(details: details)
34
34
  end
35
35
 
36
36
  def debug(message:, details: {})
37
37
  return false if %w[none error info].include?(@level) || message.nil?
38
38
 
39
39
  _format_msg(mode: 'debug', msg: message)
40
- _format_msg(mode: 'debug', msg: details) unless details.nil? || (details.is_a?(Hash) && details.keys.empty?)
40
+ _format_msg(mode: 'debug', msg: details) unless _valid_details(details: details)
41
41
  end
42
42
 
43
43
  private
44
44
 
45
+ def _valid_details(details: nil)
46
+ return false if details.nil?
47
+ return false if details.is_a?(Hash) && details.keys.empty?
48
+ return false if details.is_a?(Array) && details.empty?
49
+
50
+ details.to_s.strip != ''
51
+ end
52
+
45
53
  # Format the start of the message with a prefix and the AWS request id if available
46
54
  def _prefix(prefix: 'INFO')
47
55
  prefix = @request_id.nil? ? "#{prefix} " : "#{prefix} RequestId: #{@request_id},"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpCloudwatch
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-06 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug