centralized_ruby_logger 0.0.2 → 0.0.3
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 +13 -3
- data/lib/httpsender.rb +1 -1
- data/lib/manager.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb0277a1e95476e263e629588ee5e3cf875cae2
|
4
|
+
data.tar.gz: 0454369fc12a4d857370f3bdd4c33f6de748c5d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c3f80f9eab86a3ad1dd4f87c91e2a7b2a801a87a0b9645e9c5f838a759070bd59a2f31f252929737bbec54422d70d9bb8f7428d65b06849a8cd762ef54e14b
|
7
|
+
data.tar.gz: f2bab48a15afabe12022ac676e77a2def92b82970a39e122d9ef06946432db26283fb995d97c5d6971eb0b73920e13639c196bf6e20af6bb7b1b5541e6044a63
|
@@ -8,7 +8,7 @@ module Coralogix
|
|
8
8
|
# Constructor.
|
9
9
|
#
|
10
10
|
# @param name - logger name.
|
11
|
-
def initialize private_key, app_name, sub_system_name, debug
|
11
|
+
def initialize private_key, app_name, sub_system_name, debug=false, type_name="Centralized Ruby"
|
12
12
|
self.debug_mode=debug
|
13
13
|
@category = CORALOGIX_CATEGORY
|
14
14
|
@manager = LoggerManager.new
|
@@ -70,7 +70,12 @@ module Coralogix
|
|
70
70
|
# @param className - log class name
|
71
71
|
# @param methodName - log method name
|
72
72
|
# @param threadId - log thread id
|
73
|
-
def log severity, message, category
|
73
|
+
def log severity, message, category=@category, named_args = {}
|
74
|
+
|
75
|
+
className = named_args.fetch(:className,"")
|
76
|
+
methodName = named_args.fetch(:methodName,"")
|
77
|
+
threadId = named_args.fetch(:threadId,Thread.current.object_id.to_s)
|
78
|
+
|
74
79
|
@manager.add_logline message, severity, category, :className => className, :methodName => methodName, :threadId => threadId
|
75
80
|
end
|
76
81
|
|
@@ -79,7 +84,12 @@ module Coralogix
|
|
79
84
|
# For instance, for info severity it will create a method:
|
80
85
|
# def info message, category: @category, className: "", methodName: "", threadId: ""
|
81
86
|
SEVERITIES.keys.each do |severity|
|
82
|
-
define_method("#{severity}") do |message, category
|
87
|
+
define_method("#{severity}") do |message, category=@category, named_args = {}|
|
88
|
+
|
89
|
+
className = named_args.fetch(:className,"")
|
90
|
+
methodName = named_args.fetch(:methodName,"")
|
91
|
+
threadId = named_args.fetch(:threadId,Thread.current.object_id.to_s)
|
92
|
+
|
83
93
|
@manager.add_logline message, SEVERITIES["#{__method__}".to_sym], category, :className => className, :methodName => methodName, :threadId => threadId
|
84
94
|
end
|
85
95
|
end
|
data/lib/httpsender.rb
CHANGED
@@ -30,7 +30,7 @@ module Coralogix
|
|
30
30
|
@http = Net::HTTP.new(@uri.host, @uri.port)
|
31
31
|
end
|
32
32
|
@http.use_ssl = true
|
33
|
-
|
33
|
+
#@http.keep_alive_timeout = 10
|
34
34
|
@http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
35
35
|
@http.read_timeout = HTTP_TIMEOUT # seconds
|
36
36
|
@http.open_timeout = HTTP_TIMEOUT # seconds
|
data/lib/manager.rb
CHANGED
@@ -29,7 +29,7 @@ module Coralogix
|
|
29
29
|
# applicationName - Application name
|
30
30
|
# subsystemName - Subsystem name
|
31
31
|
# @return [boolean] return true for success or false for failure.
|
32
|
-
def configure
|
32
|
+
def configure args={}
|
33
33
|
begin
|
34
34
|
@bulk_template = args.merge({:computerName => `hostname`.strip})
|
35
35
|
DebugLogger.info "Successfully configured Coralogix logger."
|
@@ -64,7 +64,7 @@ module Coralogix
|
|
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
66
|
# @return [boolean] return true for success or false for failure.
|
67
|
-
def add_logline message, severity, category,
|
67
|
+
def add_logline message, severity, category, args={}
|
68
68
|
begin
|
69
69
|
@mutex.synchronize do
|
70
70
|
if @buffer_size < MAX_LOG_BUFFER_SIZE
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Royee Goldberg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-01-17 00:00:00.000000000 Z
|
@@ -27,7 +27,7 @@ homepage: http://www.coralogix.com
|
|
27
27
|
licenses:
|
28
28
|
- MIT
|
29
29
|
metadata: {}
|
30
|
-
post_install_message:
|
30
|
+
post_install_message:
|
31
31
|
rdoc_options: []
|
32
32
|
require_paths:
|
33
33
|
- lib
|
@@ -42,9 +42,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
rubyforge_project:
|
46
|
-
rubygems_version: 2.
|
47
|
-
signing_key:
|
45
|
+
rubyforge_project:
|
46
|
+
rubygems_version: 2.4.8
|
47
|
+
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: Coralogix Centralized Ruby Logger SDK
|
50
50
|
test_files: []
|