Module: Output::ClassMethods
- Defined in:
- lib/output/output.rb
Instance Method Summary collapse
- #default_device_type ⇒ Object
- #default_pattern ⇒ Object
- #device(device) ⇒ Object
- #device_options ⇒ Object
- #logger_level ⇒ Object
- #logger_level=(level = nil) ⇒ Object (also: #level)
- #pattern(format) ⇒ Object
- #writer_attribute(name) ⇒ Object
- #writer_macro(name, options = {}, &message_transformer) ⇒ Object (also: #writer)
- #writer_names ⇒ Object
Instance Method Details
#default_device_type ⇒ Object
191 192 193 |
# File 'lib/output/output.rb', line 191 def default_device_type @device ||= ::Output::DEFAULT_DEVICE end |
#default_pattern ⇒ Object
183 184 185 |
# File 'lib/output/output.rb', line 183 def default_pattern @pattern ||= Output::DEFAULT_PATTERN end |
#device(device) ⇒ Object
195 196 197 |
# File 'lib/output/output.rb', line 195 def device(device) @device = device end |
#device_options ⇒ Object
214 215 216 217 218 219 |
# File 'lib/output/output.rb', line 214 def = {} [:device] = default_device_type [:pattern] = default_pattern end |
#logger_level ⇒ Object
199 200 201 |
# File 'lib/output/output.rb', line 199 def logger_level @logger_level ||= Output::DEFAULT_LOGGER_LEVEL end |
#logger_level=(level = nil) ⇒ Object Also known as: level
204 205 206 207 |
# File 'lib/output/output.rb', line 204 def logger_level=(level=nil) @logger_level = level unless level.nil? @logger_level end |
#pattern(format) ⇒ Object
187 188 189 |
# File 'lib/output/output.rb', line 187 def pattern(format) @pattern = format end |
#writer_attribute(name) ⇒ Object
231 232 233 |
# File 'lib/output/output.rb', line 231 def writer_attribute(name) Writer::Attribute.attribute_name(name) end |
#writer_macro(name, options = {}, &message_transformer) ⇒ Object Also known as: writer
221 222 223 224 225 226 227 |
# File 'lib/output/output.rb', line 221 def writer_macro(name, = {}, &) level = [:level] || logger_level = .merge() WriterMacro.define_writer self, name, level, , writer_names << name end |
#writer_names ⇒ Object
210 211 212 |
# File 'lib/output/output.rb', line 210 def writer_names @writer_names ||= [] end |