Class: Embulk::Slf4jAdapter

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

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Slf4jAdapter

Returns a new instance of Slf4jAdapter



69
70
71
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 69

def initialize(logger)
  @logger = logger
end

Instance Method Details

#debug(message, &block) ⇒ Object



103
104
105
106
107
108
109
110
111
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 103

def debug(message, &block)
  if block
    if @logger.isDebugEnabled
      @logger.debug(block.call)
    end
  else
    @logger.debug(message)
  end
end

#debug?Boolean

Returns:

  • (Boolean)


135
136
137
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 135

def debug?
  @logger.isDebugEnabled()
end

#error(message, &block) ⇒ Object



73
74
75
76
77
78
79
80
81
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 73

def error(message, &block)
  if block
    if @logger.isErrorEnabled
      @logger.error(block.call)
    end
  else
    @logger.error(message)
  end
end

#error?Boolean

Returns:

  • (Boolean)


127
128
129
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 127

def error?
  @logger.isErrorEnabled()
end

#fatal?Boolean

Returns:

  • (Boolean)


123
124
125
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 123

def fatal?
  @logger.isErrorEnabled()
end

#info(message, &block) ⇒ Object



93
94
95
96
97
98
99
100
101
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 93

def info(message, &block)
  if block
    if @logger.isInfoEnabled
      @logger.info(block.call)
    end
  else
    @logger.info(message)
  end
end

#trace(message, &block) ⇒ Object



113
114
115
116
117
118
119
120
121
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 113

def trace(message, &block)
  if block
    if @logger.isTraceEnabled
      @logger.trace(block.call)
    end
  else
    @logger.trace(message)
  end
end

#trace?Boolean

Returns:

  • (Boolean)


139
140
141
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 139

def trace?
  @logger.isTraceEnabled()
end

#warn(message, &block) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 83

def warn(message, &block)
  if block
    if @logger.isWarnEnabled
      @logger.warn(block.call)
    end
  else
    @logger.warn(message)
  end
end

#warn?Boolean

Returns:

  • (Boolean)


131
132
133
# File 'embulk-core/src/main/ruby/embulk/logger.rb', line 131

def warn?
  @logger.isWarnEnabled()
end