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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9373479e35e4d86ac82de71d84090d2495d24041
4
- data.tar.gz: 819ac0171696e73b5e5fed3bca99d0d8653aa83d
3
+ metadata.gz: 0bb0277a1e95476e263e629588ee5e3cf875cae2
4
+ data.tar.gz: 0454369fc12a4d857370f3bdd4c33f6de748c5d5
5
5
  SHA512:
6
- metadata.gz: a76d4210b0e70837a323414455b32f642c6db6509c58d601e3515893531c7ada87500552f8f39fd2621daa7a271be02d06bcc2589a97adfc06861ef916a81431
7
- data.tar.gz: 8f01547c0d7580e7fad69f33a3fd60356078f1be9570678c5f228165c7868ac975fb5392a5ce09f2a7368b0f3f4f706ddad1aa97db40e4c588592984f3fa9a84
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: false, type_name: "Centralized Ruby"
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: @category, className: "", methodName: "", threadId: Thread.current.object_id.to_s
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: @category, className: "", methodName: "", threadId: Thread.current.object_id.to_s|
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
- @http.keep_alive_timeout = 10
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 **args
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, **args
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.2
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.5.1
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: []