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 +4 -4
- data/lib/centralized_ruby_logger.rb +2 -2
- data/lib/manager.rb +6 -3
- 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: 284ef6a7a04a2b02eecf798ad5331630a64fe2a9
|
4
|
+
data.tar.gz: 3079d66dca0f547ffc62e43a0cce7970f1c478a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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, :
|
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.
|
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.
|
46
|
+
rubygems_version: 2.5.2
|
47
47
|
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: Coralogix Centralized Ruby Logger SDK
|