Class: Embulk::StandardLoggerAdapter

Inherits:
Logger
  • Object
show all
Includes:
Logger::Adapter
Defined in:
embulk-core/src/main/ruby/embulk/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ StandardLoggerAdapter

Returns a new instance of StandardLoggerAdapter



44
45
46
47
48
49
50
51
52
53
54
55
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 44

def initialize(*args)
  super
  if RUBY_PLATFORM =~ /java/i
    self.formatter = lambda do |severity,datetime,progname,message|
      "#{datetime.strftime("%Y-%m-%d %H:%M:%S.%3N %z")} [#{severity}] (#{java.lang.Thread.currentThread.name}): #{message}\n"
    end
  else
    self.formatter = lambda do |severity,datetime,progname,message|
      "#{datetime.strftime("%Y-%m-%d %H:%M:%S.%3N %z")} [#{severity}]: #{message}\n"
    end
  end
end

Instance Method Details

#trace(message, &block) ⇒ Object



57
58
59
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 57

def trace(message, &block)
  debug(message, &block)
end

#trace?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 61

def trace?
  debug?
end