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
193 194 195 |
# File 'lib/output/output.rb', line 193 def default_device_type @device ||= ::Output::DEFAULT_DEVICE end |
#default_pattern ⇒ Object
185 186 187 |
# File 'lib/output/output.rb', line 185 def default_pattern @pattern ||= Output::DEFAULT_PATTERN end |
#device(device) ⇒ Object
197 198 199 |
# File 'lib/output/output.rb', line 197 def device(device) @device = device end |
#device_options ⇒ Object
216 217 218 219 220 221 |
# File 'lib/output/output.rb', line 216 def = {} [:device] = default_device_type [:pattern] = default_pattern end |
#logger_level ⇒ Object
201 202 203 |
# File 'lib/output/output.rb', line 201 def logger_level @logger_level ||= Output::DEFAULT_LOGGER_LEVEL end |
#logger_level=(level = nil) ⇒ Object Also known as: level
206 207 208 209 |
# File 'lib/output/output.rb', line 206 def logger_level=(level=nil) @logger_level = level unless level.nil? @logger_level end |
#pattern(format) ⇒ Object
189 190 191 |
# File 'lib/output/output.rb', line 189 def pattern(format) @pattern = format end |
#writer_attribute(name) ⇒ Object
234 235 236 |
# File 'lib/output/output.rb', line 234 def writer_attribute(name) Writer::Attribute.attribute_name(name) end |
#writer_macro(name, options = {}, &message_transformer) ⇒ Object Also known as: writer
224 225 226 227 228 229 230 |
# File 'lib/output/output.rb', line 224 def writer_macro(name, = {}, &) level = [:level] || logger_level = .merge() WriterMacro.define_writer self, name, level, , writer_names << name end |
#writer_names ⇒ Object
212 213 214 |
# File 'lib/output/output.rb', line 212 def writer_names @writer_names ||= [] end |