appsignal 3.3.8-java → 3.3.10-java

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: 35ea1bb6c0b8149bf0ec44f55a8ab59655ea4149e40656122d39ede681bf4776
4
- data.tar.gz: 6b8e85945c4517cedff96f03d304e945f70dbc5f0ee53afb153fe0ed35a8bcdd
3
+ metadata.gz: 3647990ee72e0eb2b33b6f57d0615a8a17abf3026d0b16c0837abc2c31ae4eb6
4
+ data.tar.gz: 6ba55a31bc34628318fe11965d60a45b5c5c7341b1a5c6f32fa43a672c4c58e5
5
5
  SHA512:
6
- metadata.gz: aca3054a5bc035c77d1d7c935988f0fc989482d74242d55f9f3879fbeba1ee037faa9644060c17bf09f36fab61f4aa25955e58d18f4846448ac436499216e9f1
7
- data.tar.gz: 0b50957a4ba08682831a8f21c7b589f0a2658ed388b17fb6b9980802a8c83f181b8464976cc8a64ab16648a2d776dfe8c723f2cda227dc6c7d954eacd75ab09d
6
+ metadata.gz: b9f10177227982ac430a2e5d4e80a76601a60705d781b80c1be8406f6e6ef52ab2e30eecec466e99b39690b20b52a76331969769a4620abfcd134134e0557dd1
7
+ data.tar.gz: fe25c533a5059981d22985bfa46ad8df4be7fbb2e25abde329b6cdba38feb8f7cf2099915db14a86cacc8461b8ce2e070492360d4f4ac89e60bd3f1b7bb817ce
@@ -846,7 +846,7 @@ blocks:
846
846
  value: latest
847
847
  commands:
848
848
  - "./support/bundler_wrapper exec rake test"
849
- - name: Ruby 2.6.9 for webmachine
849
+ - name: Ruby 2.6.9 for webmachine1
850
850
  env_vars:
851
851
  - *2
852
852
  - *3
@@ -855,9 +855,27 @@ blocks:
855
855
  - name: RUBY_VERSION
856
856
  value: 2.6.9
857
857
  - name: GEMSET
858
- value: webmachine
858
+ value: webmachine1
859
859
  - name: BUNDLE_GEMFILE
860
- value: gemfiles/webmachine.gemfile
860
+ value: gemfiles/webmachine1.gemfile
861
+ - name: _RUBYGEMS_VERSION
862
+ value: latest
863
+ - name: _BUNDLER_VERSION
864
+ value: latest
865
+ commands:
866
+ - "./support/bundler_wrapper exec rake test"
867
+ - name: Ruby 2.6.9 for webmachine2
868
+ env_vars:
869
+ - *2
870
+ - *3
871
+ - *4
872
+ - *5
873
+ - name: RUBY_VERSION
874
+ value: 2.6.9
875
+ - name: GEMSET
876
+ value: webmachine2
877
+ - name: BUNDLE_GEMFILE
878
+ value: gemfiles/webmachine2.gemfile
861
879
  - name: _RUBYGEMS_VERSION
862
880
  value: latest
863
881
  - name: _BUNDLER_VERSION
@@ -1239,7 +1257,25 @@ blocks:
1239
1257
  value: latest
1240
1258
  commands:
1241
1259
  - "./support/bundler_wrapper exec rake test"
1242
- - name: Ruby 2.7.7 for webmachine
1260
+ - name: Ruby 2.7.7 for webmachine1
1261
+ env_vars:
1262
+ - *2
1263
+ - *3
1264
+ - *4
1265
+ - *5
1266
+ - name: RUBY_VERSION
1267
+ value: 2.7.7
1268
+ - name: GEMSET
1269
+ value: webmachine1
1270
+ - name: BUNDLE_GEMFILE
1271
+ value: gemfiles/webmachine1.gemfile
1272
+ - name: _RUBYGEMS_VERSION
1273
+ value: latest
1274
+ - name: _BUNDLER_VERSION
1275
+ value: latest
1276
+ commands:
1277
+ - "./support/bundler_wrapper exec rake test"
1278
+ - name: Ruby 2.7.7 for webmachine2
1243
1279
  env_vars:
1244
1280
  - *2
1245
1281
  - *3
@@ -1248,9 +1284,9 @@ blocks:
1248
1284
  - name: RUBY_VERSION
1249
1285
  value: 2.7.7
1250
1286
  - name: GEMSET
1251
- value: webmachine
1287
+ value: webmachine2
1252
1288
  - name: BUNDLE_GEMFILE
1253
- value: gemfiles/webmachine.gemfile
1289
+ value: gemfiles/webmachine2.gemfile
1254
1290
  - name: _RUBYGEMS_VERSION
1255
1291
  value: latest
1256
1292
  - name: _BUNDLER_VERSION
@@ -1596,7 +1632,7 @@ blocks:
1596
1632
  value: latest
1597
1633
  commands:
1598
1634
  - "./support/bundler_wrapper exec rake test"
1599
- - name: Ruby 3.0.5 for webmachine
1635
+ - name: Ruby 3.0.5 for webmachine1
1600
1636
  env_vars:
1601
1637
  - *2
1602
1638
  - *3
@@ -1605,9 +1641,27 @@ blocks:
1605
1641
  - name: RUBY_VERSION
1606
1642
  value: 3.0.5
1607
1643
  - name: GEMSET
1608
- value: webmachine
1644
+ value: webmachine1
1609
1645
  - name: BUNDLE_GEMFILE
1610
- value: gemfiles/webmachine.gemfile
1646
+ value: gemfiles/webmachine1.gemfile
1647
+ - name: _RUBYGEMS_VERSION
1648
+ value: latest
1649
+ - name: _BUNDLER_VERSION
1650
+ value: latest
1651
+ commands:
1652
+ - "./support/bundler_wrapper exec rake test"
1653
+ - name: Ruby 3.0.5 for webmachine2
1654
+ env_vars:
1655
+ - *2
1656
+ - *3
1657
+ - *4
1658
+ - *5
1659
+ - name: RUBY_VERSION
1660
+ value: 3.0.5
1661
+ - name: GEMSET
1662
+ value: webmachine2
1663
+ - name: BUNDLE_GEMFILE
1664
+ value: gemfiles/webmachine2.gemfile
1611
1665
  - name: _RUBYGEMS_VERSION
1612
1666
  value: latest
1613
1667
  - name: _BUNDLER_VERSION
@@ -1935,7 +1989,7 @@ blocks:
1935
1989
  value: latest
1936
1990
  commands:
1937
1991
  - "./support/bundler_wrapper exec rake test"
1938
- - name: Ruby 3.1.3 for webmachine
1992
+ - name: Ruby 3.1.3 for webmachine1
1939
1993
  env_vars:
1940
1994
  - *2
1941
1995
  - *3
@@ -1944,9 +1998,27 @@ blocks:
1944
1998
  - name: RUBY_VERSION
1945
1999
  value: 3.1.3
1946
2000
  - name: GEMSET
1947
- value: webmachine
2001
+ value: webmachine1
1948
2002
  - name: BUNDLE_GEMFILE
1949
- value: gemfiles/webmachine.gemfile
2003
+ value: gemfiles/webmachine1.gemfile
2004
+ - name: _RUBYGEMS_VERSION
2005
+ value: latest
2006
+ - name: _BUNDLER_VERSION
2007
+ value: latest
2008
+ commands:
2009
+ - "./support/bundler_wrapper exec rake test"
2010
+ - name: Ruby 3.1.3 for webmachine2
2011
+ env_vars:
2012
+ - *2
2013
+ - *3
2014
+ - *4
2015
+ - *5
2016
+ - name: RUBY_VERSION
2017
+ value: 3.1.3
2018
+ - name: GEMSET
2019
+ value: webmachine2
2020
+ - name: BUNDLE_GEMFILE
2021
+ value: gemfiles/webmachine2.gemfile
1950
2022
  - name: _RUBYGEMS_VERSION
1951
2023
  value: latest
1952
2024
  - name: _BUNDLER_VERSION
@@ -2274,7 +2346,25 @@ blocks:
2274
2346
  value: latest
2275
2347
  commands:
2276
2348
  - "./support/bundler_wrapper exec rake test"
2277
- - name: Ruby 3.2.1 for webmachine
2349
+ - name: Ruby 3.2.1 for webmachine1
2350
+ env_vars:
2351
+ - *2
2352
+ - *3
2353
+ - *4
2354
+ - *5
2355
+ - name: RUBY_VERSION
2356
+ value: 3.2.1
2357
+ - name: GEMSET
2358
+ value: webmachine1
2359
+ - name: BUNDLE_GEMFILE
2360
+ value: gemfiles/webmachine1.gemfile
2361
+ - name: _RUBYGEMS_VERSION
2362
+ value: latest
2363
+ - name: _BUNDLER_VERSION
2364
+ value: latest
2365
+ commands:
2366
+ - "./support/bundler_wrapper exec rake test"
2367
+ - name: Ruby 3.2.1 for webmachine2
2278
2368
  env_vars:
2279
2369
  - *2
2280
2370
  - *3
@@ -2283,9 +2373,9 @@ blocks:
2283
2373
  - name: RUBY_VERSION
2284
2374
  value: 3.2.1
2285
2375
  - name: GEMSET
2286
- value: webmachine
2376
+ value: webmachine2
2287
2377
  - name: BUNDLE_GEMFILE
2288
- value: gemfiles/webmachine.gemfile
2378
+ value: gemfiles/webmachine2.gemfile
2289
2379
  - name: _RUBYGEMS_VERSION
2290
2380
  value: latest
2291
2381
  - name: _BUNDLER_VERSION
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.3.10
4
+
5
+ ### Fixed
6
+
7
+ - [48389475](https://github.com/appsignal/appsignal-ruby/commit/48389475f7739f5688e0251902227404e5f93b96) patch - The `Appsignal::Logger` is now compatible with `ActiveSupport::Logger.broadcast`.
8
+
9
+ ## 3.3.9
10
+
11
+ ### Fixed
12
+
13
+ - [a6db61b9](https://github.com/appsignal/appsignal-ruby/commit/a6db61b9a14a5a3b4ba89c99d35229bcdee98f94) patch - Fixed an error when using our Logging feature with Ruby's default logger formatter.
14
+
3
15
  ## 3.3.8
4
16
 
5
17
  ### Added
data/build_matrix.yml CHANGED
@@ -339,4 +339,5 @@ matrix:
339
339
  - "2.6.9"
340
340
  - "2.7.7"
341
341
  - gem: "sinatra"
342
- - gem: "webmachine"
342
+ - gem: "webmachine1"
343
+ - gem: "webmachine2"
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'webmachine'
3
+ gem 'webmachine', '~> 1.6'
4
4
  gem 'webrick'
5
5
 
6
6
  gemspec :path => '../'
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "webmachine", "~> 2.0"
4
+ gem "webrick"
5
+
6
+ gemspec :path => "../"
@@ -5,10 +5,17 @@ require "set"
5
5
 
6
6
  module Appsignal
7
7
  # Logger that flushes logs to the AppSignal logging service
8
- class Logger < ::Logger # rubocop:disable Metrics/ClassLength
8
+ class Logger < ::Logger
9
9
  PLAINTEXT = 0
10
10
  LOGFMT = 1
11
11
  JSON = 2
12
+ SEVERITY_MAP = {
13
+ DEBUG => 2,
14
+ INFO => 3,
15
+ WARN => 5,
16
+ ERROR => 6,
17
+ FATAL => 7
18
+ }.freeze
12
19
 
13
20
  # Create a new logger instance
14
21
  #
@@ -25,7 +32,7 @@ module Appsignal
25
32
  # We support the various methods in the Ruby
26
33
  # logger class by supplying this method.
27
34
  # @api private
28
- def add(severity, message = nil, group = nil) # rubocop:disable Metrics/CyclomaticComplexity
35
+ def add(severity, message = nil, group = nil, attributes = {})
29
36
  severity ||= UNKNOWN
30
37
  return true if severity < level
31
38
  group = @group if group.nil?
@@ -38,27 +45,14 @@ module Appsignal
38
45
  end
39
46
  end
40
47
  return if message.nil?
41
- message = formatter.call(severity, 0, group, message) if formatter
42
- severity_number = case severity
43
- when DEBUG
44
- 2
45
- when INFO
46
- 3
47
- when WARN
48
- 5
49
- when ERROR
50
- 6
51
- when FATAL
52
- 7
53
- else
54
- 0
55
- end
48
+ message = formatter.call(severity, Time.now, group, message) if formatter
49
+
56
50
  Appsignal::Extension.log(
57
51
  group,
58
- severity_number,
52
+ SEVERITY_MAP.fetch(severity, 0),
59
53
  @format,
60
54
  message,
61
- Appsignal::Utils::Data.generate({})
55
+ Appsignal::Utils::Data.generate(attributes)
62
56
  )
63
57
  end
64
58
  alias log add
@@ -71,14 +65,7 @@ module Appsignal
71
65
  return if DEBUG < level
72
66
  message = yield if message.nil? && block_given?
73
67
  return if message.nil?
74
- message = formatter.call(DEBUG, 0, @group, message) if formatter
75
- Appsignal::Extension.log(
76
- @group,
77
- 2,
78
- @format,
79
- message,
80
- Appsignal::Utils::Data.generate(attributes)
81
- )
68
+ add(DEBUG, message, @group, attributes)
82
69
  end
83
70
 
84
71
  # Log an info level message
@@ -89,14 +76,7 @@ module Appsignal
89
76
  return if INFO < level
90
77
  message = yield if message.nil? && block_given?
91
78
  return if message.nil?
92
- message = formatter.call(INFO, 0, @group, message) if formatter
93
- Appsignal::Extension.log(
94
- @group,
95
- 3,
96
- @format,
97
- message,
98
- Appsignal::Utils::Data.generate(attributes)
99
- )
79
+ add(INFO, message, @group, attributes)
100
80
  end
101
81
 
102
82
  # Log a warn level message
@@ -107,14 +87,7 @@ module Appsignal
107
87
  return if WARN < level
108
88
  message = yield if message.nil? && block_given?
109
89
  return if message.nil?
110
- message = formatter.call(WARN, 0, @group, message) if formatter
111
- Appsignal::Extension.log(
112
- @group,
113
- 5,
114
- @format,
115
- message,
116
- Appsignal::Utils::Data.generate(attributes)
117
- )
90
+ add(WARN, message, @group, attributes)
118
91
  end
119
92
 
120
93
  # Log an error level message
@@ -125,14 +98,7 @@ module Appsignal
125
98
  return if ERROR < level
126
99
  message = yield if message.nil? && block_given?
127
100
  return if message.nil?
128
- message = formatter.call(ERROR, 0, @group, message) if formatter
129
- Appsignal::Extension.log(
130
- @group,
131
- 6,
132
- @format,
133
- message,
134
- Appsignal::Utils::Data.generate(attributes)
135
- )
101
+ add(ERROR, message, @group, attributes)
136
102
  end
137
103
 
138
104
  # Log a fatal level message
@@ -143,14 +109,7 @@ module Appsignal
143
109
  return if FATAL < level
144
110
  message = yield if message.nil? && block_given?
145
111
  return if message.nil?
146
- message = formatter.call(FATAL, 0, @group, message) if formatter
147
- Appsignal::Extension.log(
148
- @group,
149
- 7,
150
- @format,
151
- message,
152
- Appsignal::Utils::Data.generate(attributes)
153
- )
112
+ add(FATAL, message, @group, attributes)
154
113
  end
155
114
  end
156
115
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.3.8".freeze
4
+ VERSION = "3.3.10".freeze
5
5
  end
@@ -115,14 +115,29 @@ describe Appsignal::Logger do
115
115
 
116
116
  context "with a formatter set" do
117
117
  before do
118
- logger.formatter = proc do |_level, _timestamp, _appname, message|
119
- "formatted: '#{message}'"
118
+ Timecop.freeze(Time.local(2023))
119
+ logger.formatter = logger.formatter = proc do |_level, timestamp, _appname, message|
120
+ # This line replicates the behaviour of the Ruby default Logger::Formatter
121
+ # which expects a timestamp object as a second argument
122
+ # https://github.com/ruby/ruby/blob/master/lib/logger/formatter.rb#L15-L17
123
+ time = timestamp.strftime("%Y-%m-%dT%H:%M:%S.%6N")
124
+ "formatted: #{time} '#{message}'"
120
125
  end
121
126
  end
122
127
 
128
+ after do
129
+ Timecop.return
130
+ end
131
+
123
132
  it "should log with a level, message and group" do
124
133
  expect(Appsignal::Extension).to receive(:log)
125
- .with("group", method[1], 0, "formatted: 'Log message'", instance_of(Appsignal::Extension::Data))
134
+ .with(
135
+ "group",
136
+ method[1],
137
+ 0,
138
+ "formatted: 2023-01-01T00:00:00.000000 'Log message'",
139
+ instance_of(Appsignal::Extension::Data)
140
+ )
126
141
  logger.send(method[0], "Log message")
127
142
  end
128
143
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.8
4
+ version: 3.3.10
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
8
8
  - Thijs Cadier
9
9
  - Tom de Bruijn
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-03-30 00:00:00.000000000 Z
13
+ date: 2023-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -196,7 +196,8 @@ files:
196
196
  - gemfiles/sequel-435.gemfile
197
197
  - gemfiles/sequel.gemfile
198
198
  - gemfiles/sinatra.gemfile
199
- - gemfiles/webmachine.gemfile
199
+ - gemfiles/webmachine1.gemfile
200
+ - gemfiles/webmachine2.gemfile
200
201
  - lib/appsignal.rb
201
202
  - lib/appsignal/auth_check.rb
202
203
  - lib/appsignal/capistrano.rb
@@ -442,7 +443,7 @@ metadata:
442
443
  documentation_uri: https://docs.appsignal.com/ruby/
443
444
  homepage_uri: https://docs.appsignal.com/ruby/
444
445
  source_code_uri: https://github.com/appsignal/appsignal-ruby
445
- post_install_message:
446
+ post_install_message:
446
447
  rdoc_options: []
447
448
  require_paths:
448
449
  - lib
@@ -458,8 +459,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
458
459
  - !ruby/object:Gem::Version
459
460
  version: '0'
460
461
  requirements: []
461
- rubygems_version: 3.1.6
462
- signing_key:
462
+ rubygems_version: 3.1.4
463
+ signing_key:
463
464
  specification_version: 4
464
465
  summary: Logs performance and exception data from your app to appsignal.com
465
466
  test_files: