Last Modified
2013-06-10 00:04:05 +0000
Requires

Description

You can use arbitrary logger which responds to debug, info, error and fatal methods, so for example the logger from standard library will work fine:

AMQ::Client.logging = true AMQ::Client.logger = MyLogger.new(STDERR)

AMQ::Client.logger defaults to a new instance of Ruby stdlib logger.

If you want to be able to log messages just from specified classes or even instances, just make the instance respond to logging and set it to desired value. So for example Queue.class_eval { def logging; true; end } will turn on logging for the whole Queue class whereas queue = Queue.new; def queue.logging; false; end will disable logging for given Queue instance.