semantic_logger 4.8.0 → 4.8.1

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: '08db65c356f23edf9786fd467263a682658523280c2518a5042238b83d122852'
4
- data.tar.gz: 7588089a257c39bc3c860e83cdeec6eb8609d64175d97b56b0d0ef24f69ecb90
3
+ metadata.gz: c969376e41c290b01fd22a111b1eca500ab4a01e80e13d4fbf18b800b9c50c9e
4
+ data.tar.gz: 4319e88ebd250dd524add711cd16508d8f825686cfa28731f19d52c35854d738
5
5
  SHA512:
6
- metadata.gz: 2b1063e5cd4e9108fe1aac892aa0f744a3f57918e5f22e63b2cd07ea44a6fb9ecc23b675bd3a8f5215ccfd073be008ca4e7ac3b30175c108f43b0d8aad963347
7
- data.tar.gz: 7c79b5fb6e25f459db53e3771df7ee413c5d0c3e2256a4480e5c3b84c8a36601a06456361e8e500df73b89b406596c8b51766589828fb4fef3bfe8a62e9a4e1e
6
+ metadata.gz: 435ada2480d22e98e3e4467086167411f0620f9a0fd4d9210bb715c7a7ef3defe08986afaf8b174aeb55a5bde8ba46dfefea1c8d693c78623495755d2a41c6e2
7
+ data.tar.gz: bb2a64552713ae4fcb3b3ae59133e4a5241ecb4692ddc7304e77f72bc76ef47e219cfd481dbebd482385e7b53e161d15b245b644c01030e9cb021c65ec222d0a
@@ -105,6 +105,10 @@ module SemanticLogger
105
105
  def flush
106
106
  @log.flush if @log.respond_to?(:flush)
107
107
  end
108
+
109
+ def console_output?
110
+ [$stderr, $stdout].include?(@log)
111
+ end
108
112
  end
109
113
  end
110
114
  end
@@ -11,8 +11,8 @@ module SemanticLogger
11
11
  def add(**args, &block)
12
12
  appender = SemanticLogger::Appender.factory(**args, &block)
13
13
 
14
- if appender.is_a?(Appender::File) && console_output?
15
- logger.warn "Ignoring attempt to add a second console appender since it would result in duplicate console output."
14
+ if appender.respond_to?(:console_output?) && appender.console_output? && console_output?
15
+ logger.warn "Ignoring attempt to add a second console appender: #{appender.class.name} since it would result in duplicate console output."
16
16
  return
17
17
  end
18
18
 
@@ -23,11 +23,7 @@ module SemanticLogger
23
23
  # Whether any of the existing appenders already output to the console?
24
24
  # I.e. Writes to stdout or stderr.
25
25
  def console_output?
26
- any? do |appender|
27
- next unless appender.is_a?(Appender::File)
28
-
29
- [$stderr, $stdout].include?(appender.instance_variable_get(:@log))
30
- end
26
+ any? { |appender| appender.respond_to?(:console_output?) && appender.console_output? }
31
27
  end
32
28
 
33
29
  def log(log)
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger
2
- VERSION = "4.8.0".freeze
2
+ VERSION = "4.8.1".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.8.0
4
+ version: 4.8.1
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-06-17 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby