semantic_logger 4.13.0 → 4.14.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: 0c00e5f1ab5a36a350afa8a082d367ec78c59b62bcfc29027fa843be48b658d4
4
- data.tar.gz: 5d77c0d14230c349b5dd58aa29b8f625ea867f7600665482a724b8f13db44f49
3
+ metadata.gz: 966d1357f842de3f83f7b0c479152a401906da47588a8f64525ea0fee406a017
4
+ data.tar.gz: 3528480641795abc6f38fe4617f4599be81b276ab4184c719b1f6ee7e555fb07
5
5
  SHA512:
6
- metadata.gz: e8c85cca0bf54d04235b12030c0602cdea04b597fcac1544819f25e1b3c40ae35a0874ed7d8b1286db370f5e4d122f812f2437f3e32c20ab45e443f3a735f641
7
- data.tar.gz: 172a1ff0b357792afba013577a326e1e2a9ea1bf3b8e83d01f8e0424e2ae9332053322ccbbda328c3607930a7f9cdec0aa5d05daa5b871fdf75182fc806d731b
6
+ metadata.gz: 6e75514558375d84db0943fbca39295c1011f9def7a86ddc2592c1de7cd0a460c61158ecbdfa35954ec768baa3bfc7b7b068ca802723b6daf64a050a31814c60
7
+ data.tar.gz: 9c351b2d1eb79c5cfbde72304e6557e0d18526746be4ef3777bb1130a2a675a069321954e617d799c7d6dc2ddc60fd425cc33b9bd9ec148d04931336aa048286
@@ -48,6 +48,11 @@ module SemanticLogger
48
48
  # password: [String]
49
49
  # Password for basic Authentication.
50
50
  #
51
+ # header: [Hash]
52
+ # Custom HTTP headers to send with each request.
53
+ # Default: {} ( do not send any custom headers)
54
+ # Example: {"Authorization" => "Bearer BEARER_TOKEN"}
55
+ #
51
56
  # compress: [true|false]
52
57
  # Whether to compress the JSON string with GZip.
53
58
  # Default: false
@@ -95,6 +100,7 @@ module SemanticLogger
95
100
  ssl: {},
96
101
  username: nil,
97
102
  password: nil,
103
+ header: {},
98
104
  proxy_url: :ENV,
99
105
  open_timeout: 2.0,
100
106
  read_timeout: 1.0,
@@ -118,7 +124,7 @@ module SemanticLogger
118
124
  "Content-Type" => "application/json",
119
125
  "Connection" => "keep-alive",
120
126
  "Keep-Alive" => "300"
121
- }
127
+ }.merge(header)
122
128
  @header["Content-Encoding"] = "gzip" if @compress
123
129
 
124
130
  uri = URI.parse(@url)
@@ -226,7 +232,7 @@ module SemanticLogger
226
232
  end
227
233
  request.basic_auth(@username, @password) if @username
228
234
  response = @http.request(request)
229
- if response.code == "200" || response.code == "201"
235
+ if response.is_a?(Net::HTTPSuccess)
230
236
  true
231
237
  else
232
238
  # Failures are logged to the global semantic logger failsafe logger (Usually stderr or file)
@@ -219,11 +219,11 @@ module SemanticLogger
219
219
 
220
220
  seconds = duration / 1000
221
221
  if seconds >= 86_400.0 # 1 day
222
- "#{(seconds / 86_400).to_i}d #{Time.at(seconds).strftime('%-Hh %-Mm')}"
222
+ "#{(seconds / 86_400).to_i}d #{Time.at(seconds).utc.strftime('%-Hh %-Mm')}"
223
223
  elsif seconds >= 3600.0 # 1 hour
224
- Time.at(seconds).strftime("%-Hh %-Mm")
224
+ Time.at(seconds).utc.strftime("%-Hh %-Mm")
225
225
  elsif seconds >= 60.0 # 1 minute
226
- Time.at(seconds).strftime("%-Mm %-Ss")
226
+ Time.at(seconds).utc.strftime("%-Mm %-Ss")
227
227
  elsif seconds >= 1.0 # 1 second
228
228
  "#{format('%.3f', seconds)}s"
229
229
  else
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger
2
- VERSION = "4.13.0".freeze
2
+ VERSION = "4.14.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.13.0
4
+ version: 4.14.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: 2023-03-26 00:00:00.000000000 Z
11
+ date: 2023-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -98,7 +98,11 @@ files:
98
98
  homepage: https://logger.rocketjob.io
99
99
  licenses:
100
100
  - Apache-2.0
101
- metadata: {}
101
+ metadata:
102
+ bug_tracker_uri: https://github.com/reidmorrison/semantic_logger/issues
103
+ documentation_uri: https://logger.rocketjob.io
104
+ source_code_uri: https://github.com/reidmorrison/semantic_logger/tree/4.14.0
105
+ rubygems_mfa_required: 'true'
102
106
  post_install_message:
103
107
  rdoc_options: []
104
108
  require_paths: