centralized_ruby_logger 0.0.8 → 0.0.9

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: 96d713cbb6f0070230dc0acf280a0fee81a0dbeb
4
- data.tar.gz: 7528b01bc50db46bcd8954389068192b63043e3e
3
+ metadata.gz: 284ef6a7a04a2b02eecf798ad5331630a64fe2a9
4
+ data.tar.gz: 3079d66dca0f547ffc62e43a0cce7970f1c478a5
5
5
  SHA512:
6
- metadata.gz: 8452e580acab17f20fe4cd17a09b59f1230d29ebb8df41b21146b3977581da4559251385541023b7a20b477c9cd453c3688c27a7fa4e83ac097c2ee8fece15f5
7
- data.tar.gz: 1bf5b8153feaedfef3dd0880b551cb656e81a4e2e48ea5ab97f104a9c5ca1953b6487e33bac9b90e050444c46f97f07c2a59a4e0f567948af7a784cede7c8ee8
6
+ metadata.gz: e204d76673a29b0cf508d807ce1636ff430e05f138805ed528fe418fac88fe47ba137341e95706a4cb72a9e4f16c9bd9e4be9d076fc594ec97052ceab83de2e5
7
+ data.tar.gz: f1433bcac07831848d10060344999d19882c2e627b7f04bf5421f0b329886abc7166b58722a32221ce1398121c7b6e1ddac031a62316fc91379cde4ca79276e3
@@ -89,8 +89,8 @@ module Coralogix
89
89
  className = named_args.fetch(:className,"")
90
90
  methodName = named_args.fetch(:methodName,"")
91
91
  threadId = named_args.fetch(:threadId,Thread.current.object_id.to_s)
92
-
93
- @manager.add_logline message, SEVERITIES["#{__method__}".to_sym], category, :className => className, :methodName => methodName, :threadId => threadId
92
+ timestamp = named_args.fetch(:timestamp, nil)
93
+ @manager.add_logline message, SEVERITIES["#{__method__}".to_sym], category, :className => className, :methodName => methodName, :threadId => threadId, :timestamp => timestamp
94
94
  end
95
95
  end
96
96
  end
data/lib/manager.rb CHANGED
@@ -63,6 +63,7 @@ module Coralogix
63
63
  # className - The class name where the log message was sent from.
64
64
  # methodName - The method name where the log message was sent from.
65
65
  # threadId - The thread id where the log message was sent from.
66
+ # timestamp - The timestamp of the log message.
66
67
  # @return [boolean] return true for success or false for failure.
67
68
  def add_logline message, severity, category, args={}
68
69
  begin
@@ -72,12 +73,14 @@ module Coralogix
72
73
  message = (message.nil? || message.to_s.strip.empty?) ? "EMPTY_STRING" : msg2str(message)
73
74
  #Validate severity
74
75
  severity = (severity.nil? || severity.to_s < Severity::DEBUG.to_s || severity.to_s > Severity::CRITICAL.to_s) ? Severity::DEBUG : severity
75
-
76
76
  #Validate category
77
77
  category = (category.nil? || category.to_s.strip.empty?) ? CORALOGIX_CATEGORY : category.to_s
78
-
79
78
  #Combine a logentry from the must parameters together with the optional one.
80
- new_entry = {:text => message, :timestamp => Time.now.utc.to_f * 1000 + @time_delta, :severity => severity, :category => category}.merge(args)
79
+ new_entry = {:text => message, :severity => severity, :category => category}.merge(args)
80
+ if new_entry[:timestamp].nil?
81
+ new_entry[:timestamp] = Time.now.utc.to_f * 1000 + @time_delta
82
+ end
83
+
81
84
  @buffer << new_entry
82
85
  #Update the buffer size to reflect the new size.
83
86
  @buffer_size+=new_entry.to_json.bytesize
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: centralized_ruby_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royee Goldberg
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 2.6.11
46
+ rubygems_version: 2.5.2
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Coralogix Centralized Ruby Logger SDK