paul_bunyan 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/.travis.yml +9 -0
- data/Dockerfile +13 -0
- data/Gemfile +6 -0
- data/Guardfile +16 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/README.rdoc +3 -0
- data/Rakefile +19 -0
- data/bin/logging_demo +17 -0
- data/build.sh +7 -0
- data/docker-compose.yml +4 -0
- data/lib/paul_bunyan.rb +70 -0
- data/lib/paul_bunyan/json_formatter.rb +122 -0
- data/lib/paul_bunyan/level.rb +28 -0
- data/lib/paul_bunyan/log_relayer.rb +148 -0
- data/lib/paul_bunyan/rails_ext.rb +7 -0
- data/lib/paul_bunyan/rails_ext/instrumentation.rb +41 -0
- data/lib/paul_bunyan/rails_ext/rack_logger.rb +24 -0
- data/lib/paul_bunyan/railtie.rb +75 -0
- data/lib/paul_bunyan/railtie/log_subscriber.rb +182 -0
- data/lib/paul_bunyan/text_formatter.rb +11 -0
- data/lib/paul_bunyan/version.rb +3 -0
- data/lib/tasks/paul_bunyan_tasks.rake +4 -0
- data/paul_bunyan.gemspec +30 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +28 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/gemfiles/40.gemfile +5 -0
- data/spec/gemfiles/40.gemfile.lock +137 -0
- data/spec/gemfiles/41.gemfile +5 -0
- data/spec/gemfiles/41.gemfile.lock +142 -0
- data/spec/gemfiles/42.gemfile +5 -0
- data/spec/gemfiles/42.gemfile.lock +167 -0
- data/spec/lib/paul_bunyan/json_formatter_spec.rb +237 -0
- data/spec/lib/paul_bunyan/level_spec.rb +78 -0
- data/spec/lib/paul_bunyan/log_relayer_spec.rb +333 -0
- data/spec/lib/paul_bunyan/rails_ext/instrumentation_spec.rb +81 -0
- data/spec/lib/paul_bunyan/railtie/log_subscriber_spec.rb +304 -0
- data/spec/lib/paul_bunyan/railtie_spec.rb +37 -0
- data/spec/lib/paul_bunyan_spec.rb +137 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/support/notification_helpers.rb +22 -0
- metadata +303 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
|
3
|
+
require "rspec"
|
4
|
+
|
5
|
+
require File.expand_path("../../spec/dummy/config/environment.rb", __FILE__)
|
6
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../spec/dummy/db/migrate", __FILE__)]
|
7
|
+
|
8
|
+
# Load support files
|
9
|
+
Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each { |f| require f }
|
10
|
+
|
11
|
+
# Load fixtures from the engine
|
12
|
+
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
13
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
14
|
+
ActiveSupport::TestCase.fixtures :all
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'pry'
|
18
|
+
require 'securerandom'
|
19
|
+
require 'stringio'
|
20
|
+
require 'paul_bunyan'
|
21
|
+
|
22
|
+
RSpec.configure do |config|
|
23
|
+
config.include NotificationHelpers
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module NotificationHelpers
|
2
|
+
def with_subscription_to(matcher, notification_callable)
|
3
|
+
subscription = ActiveSupport::Notifications.subscribe(matcher, notification_callable)
|
4
|
+
yield
|
5
|
+
ensure
|
6
|
+
ActiveSupport::Notifications.unsubscribe(subscription)
|
7
|
+
end
|
8
|
+
|
9
|
+
def listeners_for(event_name)
|
10
|
+
ActiveSupport::Notifications.notifier.listeners_for(event_name)
|
11
|
+
end
|
12
|
+
|
13
|
+
def subscribers_for(event_name)
|
14
|
+
listeners_for(event_name).map{ |listener|
|
15
|
+
listener.instance_variable_get('@delegate')
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def subscriber_classes_for(event_name)
|
20
|
+
subscribers_for(event_name).map(&:class)
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,303 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paul_bunyan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Duane Johnson
|
8
|
+
- Kenneth Romney
|
9
|
+
- Mark Severson
|
10
|
+
- Tyler Pickett
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2015-08-28 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: request_store
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - "~>"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '1.5'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.5'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: rake
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rspec
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: guard-rspec
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: wwtd
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rails
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: sqlite3
|
116
|
+
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
description: 'Extensions and enhancements to Ruby''s built in Logger class. Extensions
|
129
|
+
include: multiple output streams, JSON formatting for easy aggregation, and a Railtie
|
130
|
+
to set some sane(ish) defaults for production Rails environments.'
|
131
|
+
email:
|
132
|
+
- duane@instructure.com
|
133
|
+
- kromney@instructure.com
|
134
|
+
- markse@instructure.com
|
135
|
+
- tpickett@instructure.com
|
136
|
+
executables:
|
137
|
+
- logging_demo
|
138
|
+
extensions: []
|
139
|
+
extra_rdoc_files: []
|
140
|
+
files:
|
141
|
+
- ".gitignore"
|
142
|
+
- ".travis.yml"
|
143
|
+
- Dockerfile
|
144
|
+
- Gemfile
|
145
|
+
- Guardfile
|
146
|
+
- LICENSE.txt
|
147
|
+
- README.md
|
148
|
+
- README.rdoc
|
149
|
+
- Rakefile
|
150
|
+
- bin/logging_demo
|
151
|
+
- build.sh
|
152
|
+
- docker-compose.yml
|
153
|
+
- lib/paul_bunyan.rb
|
154
|
+
- lib/paul_bunyan/json_formatter.rb
|
155
|
+
- lib/paul_bunyan/level.rb
|
156
|
+
- lib/paul_bunyan/log_relayer.rb
|
157
|
+
- lib/paul_bunyan/rails_ext.rb
|
158
|
+
- lib/paul_bunyan/rails_ext/instrumentation.rb
|
159
|
+
- lib/paul_bunyan/rails_ext/rack_logger.rb
|
160
|
+
- lib/paul_bunyan/railtie.rb
|
161
|
+
- lib/paul_bunyan/railtie/log_subscriber.rb
|
162
|
+
- lib/paul_bunyan/text_formatter.rb
|
163
|
+
- lib/paul_bunyan/version.rb
|
164
|
+
- lib/tasks/paul_bunyan_tasks.rake
|
165
|
+
- paul_bunyan.gemspec
|
166
|
+
- spec/dummy/Rakefile
|
167
|
+
- spec/dummy/app/assets/images/.keep
|
168
|
+
- spec/dummy/app/assets/javascripts/application.js
|
169
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
170
|
+
- spec/dummy/app/controllers/application_controller.rb
|
171
|
+
- spec/dummy/app/controllers/concerns/.keep
|
172
|
+
- spec/dummy/app/helpers/application_helper.rb
|
173
|
+
- spec/dummy/app/mailers/.keep
|
174
|
+
- spec/dummy/app/models/.keep
|
175
|
+
- spec/dummy/app/models/concerns/.keep
|
176
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
177
|
+
- spec/dummy/bin/bundle
|
178
|
+
- spec/dummy/bin/rails
|
179
|
+
- spec/dummy/bin/rake
|
180
|
+
- spec/dummy/bin/setup
|
181
|
+
- spec/dummy/config.ru
|
182
|
+
- spec/dummy/config/application.rb
|
183
|
+
- spec/dummy/config/boot.rb
|
184
|
+
- spec/dummy/config/database.yml
|
185
|
+
- spec/dummy/config/environment.rb
|
186
|
+
- spec/dummy/config/environments/development.rb
|
187
|
+
- spec/dummy/config/environments/production.rb
|
188
|
+
- spec/dummy/config/environments/test.rb
|
189
|
+
- spec/dummy/config/initializers/assets.rb
|
190
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
191
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
192
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
193
|
+
- spec/dummy/config/initializers/inflections.rb
|
194
|
+
- spec/dummy/config/initializers/mime_types.rb
|
195
|
+
- spec/dummy/config/initializers/secret_token.rb
|
196
|
+
- spec/dummy/config/initializers/session_store.rb
|
197
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
198
|
+
- spec/dummy/config/locales/en.yml
|
199
|
+
- spec/dummy/config/routes.rb
|
200
|
+
- spec/dummy/config/secrets.yml
|
201
|
+
- spec/dummy/lib/assets/.keep
|
202
|
+
- spec/dummy/log/.keep
|
203
|
+
- spec/dummy/public/404.html
|
204
|
+
- spec/dummy/public/422.html
|
205
|
+
- spec/dummy/public/500.html
|
206
|
+
- spec/dummy/public/favicon.ico
|
207
|
+
- spec/gemfiles/40.gemfile
|
208
|
+
- spec/gemfiles/40.gemfile.lock
|
209
|
+
- spec/gemfiles/41.gemfile
|
210
|
+
- spec/gemfiles/41.gemfile.lock
|
211
|
+
- spec/gemfiles/42.gemfile
|
212
|
+
- spec/gemfiles/42.gemfile.lock
|
213
|
+
- spec/lib/paul_bunyan/json_formatter_spec.rb
|
214
|
+
- spec/lib/paul_bunyan/level_spec.rb
|
215
|
+
- spec/lib/paul_bunyan/log_relayer_spec.rb
|
216
|
+
- spec/lib/paul_bunyan/rails_ext/instrumentation_spec.rb
|
217
|
+
- spec/lib/paul_bunyan/railtie/log_subscriber_spec.rb
|
218
|
+
- spec/lib/paul_bunyan/railtie_spec.rb
|
219
|
+
- spec/lib/paul_bunyan_spec.rb
|
220
|
+
- spec/spec_helper.rb
|
221
|
+
- spec/support/notification_helpers.rb
|
222
|
+
homepage: ''
|
223
|
+
licenses:
|
224
|
+
- MIT
|
225
|
+
metadata: {}
|
226
|
+
post_install_message:
|
227
|
+
rdoc_options: []
|
228
|
+
require_paths:
|
229
|
+
- lib
|
230
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
231
|
+
requirements:
|
232
|
+
- - ">="
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: '0'
|
235
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
236
|
+
requirements:
|
237
|
+
- - ">="
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
version: '0'
|
240
|
+
requirements: []
|
241
|
+
rubyforge_project:
|
242
|
+
rubygems_version: 2.4.5
|
243
|
+
signing_key:
|
244
|
+
specification_version: 4
|
245
|
+
summary: Logging for all the things
|
246
|
+
test_files:
|
247
|
+
- spec/dummy/Rakefile
|
248
|
+
- spec/dummy/app/assets/images/.keep
|
249
|
+
- spec/dummy/app/assets/javascripts/application.js
|
250
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
251
|
+
- spec/dummy/app/controllers/application_controller.rb
|
252
|
+
- spec/dummy/app/controllers/concerns/.keep
|
253
|
+
- spec/dummy/app/helpers/application_helper.rb
|
254
|
+
- spec/dummy/app/mailers/.keep
|
255
|
+
- spec/dummy/app/models/.keep
|
256
|
+
- spec/dummy/app/models/concerns/.keep
|
257
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
258
|
+
- spec/dummy/bin/bundle
|
259
|
+
- spec/dummy/bin/rails
|
260
|
+
- spec/dummy/bin/rake
|
261
|
+
- spec/dummy/bin/setup
|
262
|
+
- spec/dummy/config.ru
|
263
|
+
- spec/dummy/config/application.rb
|
264
|
+
- spec/dummy/config/boot.rb
|
265
|
+
- spec/dummy/config/database.yml
|
266
|
+
- spec/dummy/config/environment.rb
|
267
|
+
- spec/dummy/config/environments/development.rb
|
268
|
+
- spec/dummy/config/environments/production.rb
|
269
|
+
- spec/dummy/config/environments/test.rb
|
270
|
+
- spec/dummy/config/initializers/assets.rb
|
271
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
272
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
273
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
274
|
+
- spec/dummy/config/initializers/inflections.rb
|
275
|
+
- spec/dummy/config/initializers/mime_types.rb
|
276
|
+
- spec/dummy/config/initializers/secret_token.rb
|
277
|
+
- spec/dummy/config/initializers/session_store.rb
|
278
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
279
|
+
- spec/dummy/config/locales/en.yml
|
280
|
+
- spec/dummy/config/routes.rb
|
281
|
+
- spec/dummy/config/secrets.yml
|
282
|
+
- spec/dummy/lib/assets/.keep
|
283
|
+
- spec/dummy/log/.keep
|
284
|
+
- spec/dummy/public/404.html
|
285
|
+
- spec/dummy/public/422.html
|
286
|
+
- spec/dummy/public/500.html
|
287
|
+
- spec/dummy/public/favicon.ico
|
288
|
+
- spec/gemfiles/40.gemfile
|
289
|
+
- spec/gemfiles/40.gemfile.lock
|
290
|
+
- spec/gemfiles/41.gemfile
|
291
|
+
- spec/gemfiles/41.gemfile.lock
|
292
|
+
- spec/gemfiles/42.gemfile
|
293
|
+
- spec/gemfiles/42.gemfile.lock
|
294
|
+
- spec/lib/paul_bunyan/json_formatter_spec.rb
|
295
|
+
- spec/lib/paul_bunyan/level_spec.rb
|
296
|
+
- spec/lib/paul_bunyan/log_relayer_spec.rb
|
297
|
+
- spec/lib/paul_bunyan/rails_ext/instrumentation_spec.rb
|
298
|
+
- spec/lib/paul_bunyan/railtie/log_subscriber_spec.rb
|
299
|
+
- spec/lib/paul_bunyan/railtie_spec.rb
|
300
|
+
- spec/lib/paul_bunyan_spec.rb
|
301
|
+
- spec/spec_helper.rb
|
302
|
+
- spec/support/notification_helpers.rb
|
303
|
+
has_rdoc:
|