fluent-logger-ruby icon indicating copy to clipboard operation
fluent-logger-ruby copied to clipboard

Fluent::Logger::TestLogger.open returns a Fluent::Logger::FluentLogger instance

Open eagletmt opened this issue 11 years ago • 3 comments

At fluent-logger 0.4.7, Fluent::Logger::TestLogger.open returns a Fluent::Logger::TestLogger instance. At fluent-logger 0.4.8, it returns a Fluent::Logger::FluentLogger instance. It's caused by https://github.com/fluent/fluent-logger-ruby/commit/2068b4468025482306ecc587d383903dc1454ff9 discussed in #10.

Is it an intended change?

eagletmt avatar Apr 14 '14 12:04 eagletmt

Hmm. We seem to do same check in Fluent::Logger::LoggerBase.open like Fluent::Logger.open.

    if !args.first.is_a?(Class) || !args.first.ancestors.include?(LoggerBase)
      args.unshift(self)
    end

repeatedly avatar Apr 14 '14 16:04 repeatedly

class LoggerBase
  def self.open(*args, &block)
    Fluent::Logger.open(*args, &block)
  end

I think that it is the problem which stopped including self in an argument by change of #16. If it is problem, I can write a patch. What do you think?

daichirata avatar Jun 10 '14 05:06 daichirata

@daic-h If you have more better solution to fix this and #16, patches are welcome!

repeatedly avatar Jun 10 '14 10:06 repeatedly