Class: Kraaken::Logger::LogDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/kraaken/logger/log_device.rb

Instance Method Summary collapse

Constructor Details

#initialize(progress_proc) ⇒ LogDevice

Returns a new instance of LogDevice.



4
5
6
# File 'lib/kraaken/logger/log_device.rb', line 4

def initialize(progress_proc)
  @progress_proc = progress_proc
end

Instance Method Details

#closeObject



16
17
# File 'lib/kraaken/logger/log_device.rb', line 16

def close
end

#write(data) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/kraaken/logger/log_device.rb', line 8

def write(data)
  if (bar = progress_bar)
    bar.log(data)
  else
    $stdout.write(data)
  end
end