Module: RGFA::LoggerSupport

Included in:
RGFA
Defined in:
lib/rgfa/logger.rb

Overview

Progress logging related-methods for RGFA class

Instance Method Summary collapse

Instance Method Details

#enable_progress_logging(part: 0.1, channel: STDERR) ⇒ RGFA

Activate logging of progress

Returns:



162
163
164
165
166
# File 'lib/rgfa/logger.rb', line 162

def enable_progress_logging(part: 0.1, channel: STDERR)
  @progress = RGFA::Logger.new(channel: channel)
  @progress.enable_progress(part: part)
  return self
end

#progress_log(symbol, progress = 1, **keyargs) ⇒ RGFA

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Updates progress logging for a computation

Parameters:

  • symbol (Symbol)

    the symbol assigned to the computation at init time

  • keyargs (Hash)

    additional units to display, with their current value (e.g. segments_processed: 10000)

  • progress (Integer) (defaults to: 1)

    how many units were processed

Returns:



179
180
181
182
# File 'lib/rgfa/logger.rb', line 179

def progress_log(symbol, progress=1, **keyargs)
  @progress.progress_log(symbol, progress) if @progress
  return self
end

#progress_log_end(symbol, **keyargs) ⇒ RGFA

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Completes progress logging for a computation

Parameters:

  • symbol (Symbol)

    the symbol assigned to the computation at init time

  • keyargs (Hash)

    additional units to display, with their current value (e.g. segments_processed: 10000)

Returns:



187
188
189
190
# File 'lib/rgfa/logger.rb', line 187

def progress_log_end(symbol, **keyargs)
  @progress.progress_end(symbol) if @progress
  return self
end

#progress_log_init(symbol, units, total, initmsg = nil) ⇒ RGFA

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize progress logging for a computation

Parameters:

  • symbol (Symbol)

    a symbol assigned to the computation

  • units (String)

    a string with the name of the units, in plural

  • total (Integer)

    total number of units

  • initmsg (String) (defaults to: nil)

    an optional message to output at the beginning

Returns:



171
172
173
174
# File 'lib/rgfa/logger.rb', line 171

def progress_log_init(symbol, units, total, initmsg = nil)
  @progress.progress_init(symbol, units, total, initmsg) if @progress
  return self
end