Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

set the fallback logdevice with logdev=. This fixes issues with some …

…weird stdin / stderr hacks of some daemon libraries
  • Loading branch information...
commit 46657ffcd4ec6c9157fa330edd0c1e55e4fb9be8 1 parent 75c1a04
@paukul authored
Showing with 12 additions and 1 deletion.
  1. +7 −1 lib/amqp_logging/log_device.rb
  2. +5 −0 lib/amqp_logging/logger.rb
View
8 lib/amqp_logging/log_device.rb
@@ -1,7 +1,7 @@
class AMQPLogging::LogDevice
RETRY_AFTER = 10.seconds
- attr_reader :exchange, :configuration
+ attr_reader :exchange, :configuration
attr_accessor :logger
def initialize(dev, opts = {})
@@ -24,9 +24,15 @@ def write(msg)
end
def close
+ reset_amqp # TODO: Test!
@fallback_logdev.close
end
+ def fallback_logdev=(io)
+ @fallback_logdev.close # TODO: Test!
+ @fallback_logdev = io
+ end
+
private
def pause_amqp_logging(exception)
@paused = Time.now
View
5 lib/amqp_logging/logger.rb
@@ -20,4 +20,9 @@ def initialize(logdev, *args)
@logdev = AMQPLogging::LogDevice.new(@logdev, options)
@logdev.logger = self
end
+
+ def fallback_logdev=(io)
+ @logdev.fallback_logdev = io
+ end
+ alias :logdev= :fallback_logdev=
end
Please sign in to comment.
Something went wrong with that request. Please try again.