paul_bunyan 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956ccef06d46e5dfffa5d275b380f268a6de7bd2
|
4
|
+
data.tar.gz: 2c69762bb62009f0a60284b007853ffd724db02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ee48f85b919d37e8d9381f6b078204f51d8ee73e6202727e5e6ac22f8789a3597c17ba86b6749aa014e8516fe7e2078caf23ff4070f88088c52a0cf0ad7dfa
|
7
|
+
data.tar.gz: 4227bdd9d9f14e611a32a5f6cfdeda41324115c8bbe289e9b17dfa1c3117b475156d8d8e59c40fbb3af78f8d53faaf17503f59c7aaf55dba1f996d7b0ce01ebd
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'active_support/logger'
|
2
|
+
|
3
|
+
# Sad hax but ActiveRecord insists on using this method for console sessions
|
4
|
+
# and everything uses it in development causing us to get double log lines :-(
|
5
|
+
module ActiveSupport
|
6
|
+
class Logger
|
7
|
+
def self.broadcast(_)
|
8
|
+
Module.new
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/paul_bunyan/railtie.rb
CHANGED
@@ -39,6 +39,10 @@ module PaulBunyan
|
|
39
39
|
Rails.logger = PaulBunyan.logger
|
40
40
|
end
|
41
41
|
|
42
|
+
console do
|
43
|
+
PaulBunyan.logger.formatter = TextFormatter.new(include_metadata: false)
|
44
|
+
end
|
45
|
+
|
42
46
|
def conditionally_unsubscribe(listener)
|
43
47
|
delegate = listener.instance_variable_get(:@delegate)
|
44
48
|
ActiveSupport::Notifications.unsubscribe(listener) if DEFAULT_LOGGERS.include?(delegate.class)
|
@@ -1,10 +1,22 @@
|
|
1
|
+
begin
|
2
|
+
require 'active_support/tagged_logging'
|
3
|
+
rescue LoadError
|
4
|
+
end
|
5
|
+
|
1
6
|
module PaulBunyan
|
2
7
|
class TextFormatter < Logger::Formatter
|
8
|
+
include ActiveSupport::TaggedLogging::Formatter if defined?(ActiveSupport::TaggedLogging)
|
9
|
+
|
10
|
+
def initialize(include_metadata: true)
|
11
|
+
@include_metadata = include_metadata
|
12
|
+
end
|
13
|
+
|
3
14
|
def call(severity, time, progname, msg)
|
4
|
-
|
5
|
-
|
15
|
+
message = (String === msg ? msg : msg.inspect)
|
16
|
+
if @include_metadata
|
17
|
+
super(severity, time, progname, message)
|
6
18
|
else
|
7
|
-
|
19
|
+
message + "\n"
|
8
20
|
end
|
9
21
|
end
|
10
22
|
end
|
data/lib/paul_bunyan/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paul_bunyan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duane Johnson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: request_store
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- lib/paul_bunyan/level.rb
|
156
156
|
- lib/paul_bunyan/log_relayer.rb
|
157
157
|
- lib/paul_bunyan/rails_ext.rb
|
158
|
+
- lib/paul_bunyan/rails_ext/active_support_logger.rb
|
158
159
|
- lib/paul_bunyan/rails_ext/instrumentation.rb
|
159
160
|
- lib/paul_bunyan/rails_ext/rack_logger.rb
|
160
161
|
- lib/paul_bunyan/railtie.rb
|