Class: Logue::LinesWriter

Inherits:
BaseWriter show all
Defined in:
lib/logue/lines/lines_writer.rb

Instance Attribute Summary

Attributes inherited from BaseWriter

#colorize_line, #colors, #output

Instance Method Summary collapse

Methods inherited from BaseWriter

#initialize, #print, #write

Constructor Details

This class inherits a constructor from Logue::BaseWriter

Instance Method Details

#write_block(location, level, &blk) ⇒ Object



18
19
20
21
# File 'lib/logue/lines/lines_writer.rb', line 18

def write_block location, level, &blk
  line = LineBlock.new blk
  write_line location, line, level
end

#write_line(location, line, level) ⇒ Object



23
24
25
26
27
# File 'lib/logue/lines/lines_writer.rb', line 23

def write_line location, line, level
  linestr = line.message_string
  lstr = location + " " + linestr
  print lstr, level
end

#write_msg_blk(location, msg, level, &blk) ⇒ Object



13
14
15
16
# File 'lib/logue/lines/lines_writer.rb', line 13

def write_msg_blk location, msg, level, &blk
  line = LineMsgBlock msg, &blk
  write_line location, line, level
end

#write_msg_obj(location, msg, obj, level) ⇒ Object



8
9
10
11
# File 'lib/logue/lines/lines_writer.rb', line 8

def write_msg_obj location, msg, obj, level
  line = LineMsgObj.new msg, obj
  write_line location, line, level
end