rails_semantic_logger 4.6.1 → 4.6.2

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: '0816ddc6820dfc94fed6b737d023c2cfdc6e6df3019d34ff1e71c40a2a6ccb2f'
4
- data.tar.gz: b0c7f329c6e1ecf72687617155d994b6c37ef731d5166e30b76543a41e825efb
3
+ metadata.gz: 6a51cc8580e730f4cf67e6525e4f560bf4b75d36f6876f89dc4381654ce58bfc
4
+ data.tar.gz: db93994bb8dde3d26e6e474f31fb1f80c225268037f8789f8a2ade91bb60f52c
5
5
  SHA512:
6
- metadata.gz: c42fadbc4b768c9f64f719e36cdf453bc80b88639fd8fe169704ae5b37375be8706b59d3ede6ef8a6eac090a0433be1fe514e90ea306f2f1288f026042e48b18
7
- data.tar.gz: f16dec6c5a4336c0d0a0a2862891ec2117cbf103257a759e8611376725167476bc090c2444a7011df7b4c4e323583f2d5392dd498dea72e03f23f3555c45bde8
6
+ metadata.gz: 652228c641c795518f5030573d8eaf434f81a0bea1104e210c1da2bef83bc0e0cd2b6f26efd3d76cf1dbe04d10f4053a717883ddbe3b6d5bedf9619151bdb121
7
+ data.tar.gz: bd56572399d0c83ec385ab9e9db12b3b7f48428c54bd71b9c905595e5c619cebaff6e9e0df8792e719d69e4e6f3693a28fba8bb5606450c56e384cedea7abade
@@ -123,6 +123,9 @@ module RailsSemanticLogger
123
123
 
124
124
  # Replace the Bugsnag logger
125
125
  Bugsnag.configure { |config| config.logger = SemanticLogger[Bugsnag] } if defined?(Bugsnag)
126
+
127
+ # Set the IOStreams PGP logger
128
+ IOStreams::Pgp.logger = SemanticLogger["IOStreams::Pgp"] if defined?(IOStreams)
126
129
  end
127
130
 
128
131
  # After any initializers run, but after the gems have been loaded
@@ -218,7 +221,10 @@ module RailsSemanticLogger
218
221
  console do |_app|
219
222
  # Don't use a background thread for logging
220
223
  SemanticLogger.sync!
221
- SemanticLogger.add_appender(io: STDERR, formatter: :color)
224
+ # Add a stderr logger when running inside a Rails console unless one has already been added.
225
+ if config.rails_semantic_logger.console_logger && !SemanticLogger::Logger.processor.appenders.console_output?
226
+ SemanticLogger.add_appender(io: STDERR, formatter: :color)
227
+ end
222
228
 
223
229
  # Include method names on log entries in the console
224
230
  SemanticLogger.backtrace_level = SemanticLogger.default_level
@@ -1,4 +1,4 @@
1
- ActionCable::Connection::TaggedLoggerProxy
1
+ require "action_cable/connection/tagged_logger_proxy"
2
2
 
3
3
  module ActionCable
4
4
  module Connection
@@ -1,5 +1,6 @@
1
1
  # Log actual exceptions, not a string representation
2
- ActionController::Live
2
+ require "action_controller"
3
+
3
4
  module ActionController
4
5
  module Live
5
6
  undef_method :log_error
@@ -1,5 +1,6 @@
1
1
  # Log actual exceptions, not a string representation
2
- ActionDispatch::DebugExceptions
2
+ require "action_dispatch"
3
+
3
4
  module ActionDispatch
4
5
  class DebugExceptions
5
6
  private
@@ -1,5 +1,5 @@
1
1
  # Log actual exceptions, not a string representation
2
- ActionView::StreamingTemplateRenderer
2
+ require "action_view/renderer/streaming_template_renderer"
3
3
 
4
4
  module ActionView
5
5
  class StreamingTemplateRenderer
@@ -7,6 +7,7 @@ module ActiveJob
7
7
 
8
8
  private
9
9
 
10
+ undef_method :tag_logger
10
11
  def tag_logger(*tags, &block)
11
12
  logger.tagged(*tags, &block)
12
13
  end
@@ -1,9 +1,11 @@
1
1
  # Patch the Rails::Server log_to_stdout so that it logs via SemanticLogger
2
- Rails::Server
2
+ require "rails"
3
+
3
4
  module Rails
4
5
  class Server
5
6
  private
6
-
7
+
8
+ undef_method :log_to_stdout
7
9
  def log_to_stdout
8
10
  wrapped_app # touch the app so the logger is set up
9
11
 
@@ -48,6 +48,10 @@ module RailsSemanticLogger
48
48
  #
49
49
  # config.rails_semantic_logger.quiet_assets = false
50
50
  #
51
+ # * Disable automatic logging to stderr when running a Rails console.
52
+ #
53
+ # config.rails_semantic_logger.console_logger = false
54
+ #
51
55
  # * Override the output format for the primary Rails log file.
52
56
  #
53
57
  # Valid options:
@@ -98,7 +102,7 @@ module RailsSemanticLogger
98
102
  # config.rails_semantic_logger.named_tags = nil
99
103
  class Options
100
104
  attr_accessor :semantic, :started, :processing, :rendered, :ap_options, :add_file_appender,
101
- :quiet_assets, :format, :named_tags, :filter
105
+ :quiet_assets, :format, :named_tags, :filter, :console_logger
102
106
 
103
107
  # Setup default values
104
108
  def initialize
@@ -112,6 +116,7 @@ module RailsSemanticLogger
112
116
  @format = :default
113
117
  @named_tags = nil
114
118
  @filter = nil
119
+ @console_logger = true
115
120
  end
116
121
  end
117
122
  end
@@ -1,3 +1,3 @@
1
1
  module RailsSemanticLogger
2
- VERSION = "4.6.1".freeze
2
+ VERSION = "4.6.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.1
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-15 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.2.22
104
+ rubygems_version: 3.2.32
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Feature rich logging framework that replaces the Rails logger.