semantic_logger 4.6.0.beta1 → 4.6.0

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
  SHA256:
3
- metadata.gz: bafa2ce169caccee2a851d7ad8a5b5b7d1e3104fa6894ff8c21756e78f59621f
4
- data.tar.gz: 110b972e305d619672761cbc34652556615d79015824c1c538c8819e69a01ec8
3
+ metadata.gz: f8f915c93d4fc1e77f71adb4db1c2c3468fc4f512c244b1429e759131e8e6a66
4
+ data.tar.gz: 74f2e1cbad5b2c8b5a33188bf7464831cdf2937a8fe4ba1e7f55ad8b724b6b87
5
5
  SHA512:
6
- metadata.gz: bec35476ebcc1af48f5b056b7f109652d86c437da257e70e82a2514dfdbf280d12cc7acd29c9c09a49ed76fbd7d7b09ac200a9d3477089685e4e2a45b9d899fe
7
- data.tar.gz: 501e8708e49344fb056e9959c8d77b2a907fbbfe938893a5000edbb1dd9f57d710abd341e5b0566f7aafdb624ea424a38815de89fa845fcdaf01563aa41c0d72
6
+ metadata.gz: cd81b9f494885ebb307c77b7765139d2f8acd89b1f28ded2883960e5b945158d290695bb2c897b7dd5fd4031babfe5c5438efa4dd5033c2d08e887d3d70c858f
7
+ data.tar.gz: b6f1a89e7bfe91bd16c7419265b4a826792452e0767b5c96fbc6bfc55df552807c6f9a7e33ecb6f0df4a947bbeb063a0a3f09865595ef288c0cc5456fcdcad64
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'bugsnag'
3
3
  rescue LoadError
4
- raise 'Gem bugsnag is required for logging purposes. Please add the gem "bugsnag" to your Gemfile.'
4
+ raise LoadError.new('Gem bugsnag is required for logging purposes. Please add the gem "bugsnag" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Send log messages to Bugsnag
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'elasticsearch'
3
3
  rescue LoadError
4
- raise 'Gem elasticsearch is required for logging to Elasticsearch. Please add the gem "elasticsearch" to your Gemfile.'
4
+ raise LoadError.new('Gem elasticsearch is required for logging to Elasticsearch. Please add the gem "elasticsearch" to your Gemfile.')
5
5
  end
6
6
 
7
7
  require 'date'
@@ -2,7 +2,7 @@ require 'uri'
2
2
  begin
3
3
  require 'gelf'
4
4
  rescue LoadError
5
- raise 'Gem gelf is required for logging to Graylog. Please add the gem "gelf" to your Gemfile.'
5
+ raise LoadError.new('Gem gelf is required for logging to Graylog. Please add the gem "gelf" to your Gemfile.')
6
6
  end
7
7
 
8
8
  # Forward log entries to a Graylog server.
@@ -118,7 +118,10 @@ module SemanticLogger
118
118
  def call(log, logger)
119
119
  h = default_formatter.call(log, logger)
120
120
 
121
- h[:short_message] = h.delete(:message) || log.exception.message
121
+ h[:short_message] = h.delete(:message)
122
+ if h[:short_message].nil?
123
+ h[:short_message] = log.exception.nil? ? '<no-exception-message>' : log.exception.message
124
+ end
122
125
  h[:level] = logger.level_map[log.level]
123
126
  h[:level_str] = log.level.to_s
124
127
  h[:duration_str] = h.delete(:duration)
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'honeybadger'
3
3
  rescue LoadError
4
- raise 'Gem honeybadger is required for logging purposes. Please add the gem "honeybadger" to your Gemfile.'
4
+ raise LoadError.new('Gem honeybadger is required for logging purposes. Please add the gem "honeybadger" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Send log messages to honeybadger
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'kafka'
3
3
  rescue LoadError
4
- raise 'Gem ruby-kafka is required for logging to Elasticsearch. Please add the gem "ruby-kafka" to your Gemfile.'
4
+ raise LoadError.new('Gem ruby-kafka is required for logging to Elasticsearch. Please add the gem "ruby-kafka" to your Gemfile.')
5
5
  end
6
6
 
7
7
  require 'date'
@@ -2,7 +2,7 @@ require 'socket'
2
2
  begin
3
3
  require 'mongo'
4
4
  rescue LoadError
5
- raise 'Gem mongo is required for logging to MongoDB. Please add the gem "mongo" v2.0 or greater to your Gemfile.'
5
+ raise LoadError.new('Gem mongo is required for logging to MongoDB. Please add the gem "mongo" v2.0 or greater to your Gemfile.')
6
6
  end
7
7
 
8
8
  module SemanticLogger
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'newrelic_rpm'
3
3
  rescue LoadError
4
- raise 'Gem newrelic_rpm is required for logging to New Relic. Please add the gem "newrelic_rpm" to your Gemfile.'
4
+ raise LoadError.new('Gem newrelic_rpm is required for logging to New Relic. Please add the gem "newrelic_rpm" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Send log messages to NewRelic
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'bunny'
3
3
  rescue LoadError
4
- raise 'Gem bunny is required for logging to RabbitMQ. Please add the gem "bunny" to your Gemfile.'
4
+ raise LoadError.new('Gem bunny is required for logging to RabbitMQ. Please add the gem "bunny" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Forward all log messages to RabbitMQ.
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'sentry-raven'
3
3
  rescue LoadError
4
- raise 'Gem sentry-raven is required for logging purposes. Please add the gem "sentry-raven" to your Gemfile.'
4
+ raise LoadError.new('Gem sentry-raven is required for logging purposes. Please add the gem "sentry-raven" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Send log messages to sentry
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'splunk-sdk-ruby'
3
3
  rescue LoadError
4
- raise 'Gem splunk-sdk-ruby is required for logging to Splunk. Please add the gem "splunk-sdk-ruby" to your Gemfile.'
4
+ raise LoadError.new('Gem splunk-sdk-ruby is required for logging to Splunk. Please add the gem "splunk-sdk-ruby" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Splunk log appender.
@@ -145,7 +145,7 @@ module SemanticLogger
145
145
  begin
146
146
  require 'syslog_protocol'
147
147
  rescue LoadError
148
- raise 'Missing gem: syslog_protocol. This gem is required when logging over TCP or UDP. To fix this error: gem install syslog_protocol'
148
+ raise LoadError.new('Missing gem: syslog_protocol. This gem is required when logging over TCP or UDP. To fix this error: gem install syslog_protocol')
149
149
  end
150
150
 
151
151
  # The net_tcp_client gem is required when logging over TCP.
@@ -153,7 +153,7 @@ module SemanticLogger
153
153
  begin
154
154
  require 'net/tcp_client'
155
155
  rescue LoadError
156
- raise 'Missing gem: net_tcp_client. This gem is required when logging over TCP. To fix this error: gem install net_tcp_client'
156
+ raise LoadError.new('Missing gem: net_tcp_client. This gem is required when logging over TCP. To fix this error: gem install net_tcp_client')
157
157
  end
158
158
  end
159
159
  end
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'net/tcp_client'
3
3
  rescue LoadError
4
- raise 'Gem net_tcp_client is required for logging over TCP. Please add the gem "net_tcp_client" to your Gemfile.'
4
+ raise LoadError.new('Gem net_tcp_client is required for logging over TCP. Please add the gem "net_tcp_client" to your Gemfile.')
5
5
  end
6
6
 
7
7
  raise 'Net::TCPClient v2.0 or greater is required to log over TCP' unless Net::TCPClient::VERSION.to_f >= 2.0
@@ -312,6 +312,9 @@ module SemanticLogger
312
312
  else
313
313
  log.assign_positional(nil, message, nil, &block)
314
314
  end
315
+ elsif exception.nil? && message && payload && payload.is_a?(Hash) &&
316
+ (payload.key?(:payload) || payload.key?(:exception) || payload.key?(:metric))
317
+ log.assign(message: message, **payload)
315
318
  else
316
319
  log.assign_positional(message, payload, exception, &block)
317
320
  end
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'syslog_protocol'
3
3
  rescue LoadError
4
- raise 'Gem syslog_protocol is required for remote logging using the Syslog protocol. Please add the gem "syslog_protocol" to your Gemfile.'
4
+ raise LoadError.new('Gem syslog_protocol is required for remote logging using the Syslog protocol. Please add the gem "syslog_protocol" to your Gemfile.')
5
5
  end
6
6
 
7
7
  module SemanticLogger
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'syslog_protocol'
3
3
  rescue LoadError
4
- raise 'Gem syslog_protocol is required for remote logging using the Syslog protocol. Please add the gem "syslog_protocol" to your Gemfile.'
4
+ raise LoadError.new('Gem syslog_protocol is required for remote logging using the Syslog protocol. Please add the gem "syslog_protocol" to your Gemfile.')
5
5
  end
6
6
 
7
7
  module SemanticLogger
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  require 'newrelic_rpm'
3
3
  rescue LoadError
4
- raise 'Gem newrelic_rpm is required for logging to New Relic. Please add the gem "newrelic_rpm" to your Gemfile.'
4
+ raise LoadError.new('Gem newrelic_rpm is required for logging to New Relic. Please add the gem "newrelic_rpm" to your Gemfile.')
5
5
  end
6
6
 
7
7
  # Send Metrics to NewRelic
@@ -2,7 +2,7 @@ require 'uri'
2
2
  begin
3
3
  require 'statsd-ruby'
4
4
  rescue LoadError
5
- raise 'Gem statsd-ruby is required for logging metrics. Please add the gem "statsd-ruby" to your Gemfile.'
5
+ raise LoadError.new('Gem statsd-ruby is required for logging metrics. Please add the gem "statsd-ruby" to your Gemfile.')
6
6
  end
7
7
 
8
8
  module SemanticLogger
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger
2
- VERSION = '4.6.0.beta1'.freeze
2
+ VERSION = '4.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0.beta1
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -102,9 +102,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: '2.3'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">"
105
+ - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 1.3.1
107
+ version: '0'
108
108
  requirements: []
109
109
  rubygems_version: 3.0.3
110
110
  signing_key: