coralogix_logger 0.0.10 → 0.0.11

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
  SHA1:
3
- metadata.gz: 8a38fbd3aa398032fdead0c2621e53fed6572373
4
- data.tar.gz: 6c26e5ea3b6181ed6395836a530df4d89918d6fc
3
+ metadata.gz: 43cd521172ca160f02d4823a03d3e9b1fafa0d7e
4
+ data.tar.gz: d14bf93d5d5f162cc1f1ae1d9b31a2d72f81a85a
5
5
  SHA512:
6
- metadata.gz: bfbcc9e4851e16d8840b6180639853a4301200ff87a09dad4c4167b5644f115f46f19fdc8d42f767987b59be52eb9f15dc307c41326669b242bbc6deaafdbfe6
7
- data.tar.gz: e48fff800f50af9a08033c5b9e3c6b98c656780a16577f907775a1f4d15dbcc5109318dbd972b7ede6e6cfe2889e3a8a13657065a1d4c837a5d32811fb320b54
6
+ metadata.gz: 830de891a52c17d4ffa53cb3d5ab2cfe5bd724b0eb0b1c6d0e4c7e5ddb0c1e712a16e59d2b9706167dff85b3a8f320eabbad91c0f74db7a1f55359324ebc0c73
7
+ data.tar.gz: c308752f1f4385f58e00744c0bcb6dcac91069d414f90e881481b231626c62feae91de8686fb52125a767b7f7cf5ee422c0b1281540c9a5ea00569295f2a5f29
@@ -61,9 +61,9 @@ module Coralogix
61
61
  # @param sub_system - sub system name
62
62
  # @return [boolean] return a true or false.
63
63
  def self.configure private_key, app_name, sub_system
64
- private_key = private_key.strip.empty? ? FAILED_PRIVATE_KEY : private_key
65
- app_name = app_name.strip.empty? ? NO_APP_NAME : app_name
66
- sub_system = sub_system.strip.empty? ? NO_SUB_SYSTEM : sub_system
64
+ private_key = (private_key.nil? || private_key.to_s.strip.empty?) ? FAILED_PRIVATE_KEY : private_key
65
+ app_name = (app_name.nil? || app_name.to_s.strip.empty?) ? NO_APP_NAME : app_name
66
+ sub_system = (sub_system.nil? || sub_system.to_s.strip.empty?) ? NO_SUB_SYSTEM : sub_system
67
67
  LoggerManager.configure(:privateKey => private_key, :applicationName => app_name, :subsystemName => sub_system) unless LoggerManager.configured
68
68
  end
69
69
 
data/lib/manager.rb CHANGED
@@ -67,6 +67,13 @@ module Coralogix
67
67
  begin
68
68
  @mutex.synchronize do
69
69
  if @buffer_size < MAX_LOG_BUFFER_SIZE
70
+
71
+ #Validate message
72
+ message = (message.nil? || message.to_s.strip.empty?) ? "EMPTY_STRING" : message
73
+
74
+ #Validate severity
75
+ severity = (severity.nil? || severity.to_s < Severity::DEBUG.to_s || severity.to_s > Severity::CRITICAL.to_s) ? Severity::DEBUG : severity
76
+
70
77
  #Combine a logentry from the must parameters together with the optional one.
71
78
  new_entry = {:text => message, :timestamp => Time.now.utc.to_f * 1000 + @time_delta, :severity => severity, :category => category}.merge(args)
72
79
  @buffer << new_entry
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coralogix_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royee Goldberg
@@ -31,17 +31,17 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.0.0
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.4.8
44
+ rubygems_version: 2.5.1
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Coralogix Ruby Logger SDK